view ifndef_wrapper.sh @ 1556:4c382cbb19e6

Added signature for changeset 2f0c3f3361d3
author Matt Johnston <matt@ucc.asn.au>
date Tue, 27 Feb 2018 22:49:06 +0800
parents 198e2ee0f4b1
children 0196f4f83fee
line wrap: on
line source

#!/bin/sh

# Wrap all "#define X Y" with a #ifndef X...#endif"

sed -E 's/^( *#define ([^ ]+) .*)/#ifndef \2\
\1\
#endif/'