view ifndef_wrapper.sh @ 1538:f20038b513a5

more linting (#58) * const parameter * fix indentation
author François Perrad <francois.perrad@gadz.org>
date Mon, 26 Feb 2018 14:31:15 +0100
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/'