view ifndef_wrapper.sh @ 1618:7bd7e95ad1f8

make writev #include consistent for variable declarations too
author Matt Johnston <matt@ucc.asn.au>
date Thu, 23 Aug 2018 23:59:24 +0800
parents 470aa609c7e4
children
line wrap: on
line source

#!/bin/sh

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

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