summaryrefslogtreecommitdiff
path: root/ifndef_wrapper.sh
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2016-05-04 15:33:40 +0200
committerMatt Johnston <matt@ucc.asn.au>2016-05-04 15:33:40 +0200
commit32a28d0d9cf7c567671366d6ec71df87627e2c49 (patch)
treeeed0f72ed707d62a28b4cb1d8da05c5d1b3f23c3 /ifndef_wrapper.sh
parentd6daad29fcfc20295473bf7e6a96f3016282e9e6 (diff)
downloaddropbear-32a28d0d9cf7c567671366d6ec71df87627e2c49.tar.gz
Convert #ifdef to #if, other build changes
Diffstat (limited to 'ifndef_wrapper.sh')
-rwxr-xr-xifndef_wrapper.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/ifndef_wrapper.sh b/ifndef_wrapper.sh
new file mode 100755
index 0000000..a5c5ce6
--- /dev/null
+++ b/ifndef_wrapper.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Wrap all "#define X Y" with a #ifndef X...#endif"
+
+sed -E 's/^(#define ([^ ]+) .*)/#ifndef \2\
+\1\
+#endif/'