:
# create macro calls for all defines in the file
-# $PostgreSQL: pgsql/src/tools/pginclude/pgdefine,v 1.3 2006/03/11 04:38:42 momjian Exp $
+# $PostgreSQL: pgsql/src/tools/pginclude/pgdefine,v 1.4 2006/07/13 16:39:20 momjian Exp $
trap "rm -f /tmp/$$" 0 1 2 3 15
for FILE
do
cat "$FILE" | grep "^#define" >/tmp/$$
- cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*$/(void)\1;/p'
- cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*([^)]*)\).*$/(=void)\1;/p' |
+ cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*\\\\$/\1;/p'
+ cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*[^\\\\]$/(void)\1;/p'
+
+ (
+ cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*([^)]*)\).*\\\\$/\1;/p'
+ cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*([^)]*)\).*[^\\\\]$/(=void)\1;/p'
+ ) |
sed 's/([a-zA-Z0-9_ ][a-zA-Z0-9_ ]*)/(0)/g' |
sed 's/([a-zA-Z0-9_ ]*,/(0,/g' |
sed 's/,[a-zA-Z0-9_ ]*,/,0,/g' |
:
# remove extra #include's
-# $PostgreSQL: pgsql/src/tools/pginclude/pgrminclude,v 1.13 2006/07/12 16:28:27 momjian Exp $
+# $PostgreSQL: pgsql/src/tools/pginclude/pgrminclude,v 1.14 2006/07/13 16:39:20 momjian Exp $
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
find . \( -name CVS -a -prune \) -o -type f -name '*.[ch]' -print |
cat /tmp/$$b
cat /tmp/$$.c
fi
+ grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' \
+ "$FILE" >/tmp/$$b
mv /tmp/$$b "$FILE"
fi
done