summaryrefslogtreecommitdiffhomepage
path: root/ifndef_wrapper.sh
blob: 37a208d41841951fae36eda697cb894dc3757cfe (plain)
1
2
3
4
5
6
7
#!/bin/sh

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

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