aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-08-26 13:09:39 -0400
committerBruce Momjian <bruce@momjian.us>2011-08-26 18:15:13 -0400
commitac5f11e0ec23e70a5749c5caee890f0b9addfc85 (patch)
tree51add0d85b02d3f10cec648b9275751f53ab9f7f /src
parent00eb036c111b8f72a34ca729efccd785761d977e (diff)
downloadpostgresql-ac5f11e0ec23e70a5749c5caee890f0b9addfc85.tar.gz
postgresql-ac5f11e0ec23e70a5749c5caee890f0b9addfc85.zip
Fix #if blocks.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/pginclude/pgrminclude25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/tools/pginclude/pgrminclude b/src/tools/pginclude/pgrminclude
index e0173fdc5f2..0f0e10b8998 100755
--- a/src/tools/pginclude/pgrminclude
+++ b/src/tools/pginclude/pgrminclude
@@ -11,19 +11,18 @@ grep -v '\./pg_config.h' |
grep -v '\./c.h' |
while read FILE
do
- # Skip files with #if and #ifdef blocks because the blocks
- # might contain code that is not compiled on this platform.
- grep -q '^#if' "$FILE" && continue
-
if [ `expr $FILE : '.*\.h$'` -ne 0 ]
then IS_INCLUDE="Y"
else IS_INCLUDE="N"
fi
# loop through all includes
- cat "$FILE" | grep "^#include" |
+ cat "$FILE" |
+ grep "^#include\>" |
grep -v '/\* *pgrminclude *ignore *\*/' |
sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
+ grep -v 'parser/kwlist\.h' |
+ grep -v '\.c$' |
while read INCLUDE
do
if [ "$1" = "-v" ]
@@ -43,12 +42,18 @@ do
grep -A1 '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" |
egrep -q '^#else|^#endif' && continue
- # remove defines from include files
+ # Remove all #if and #ifdef blocks because the blocks
+ # might contain code that is not compiled on this platform.
+ cat "$FILE" |
+ grep -v "^#if" |
+ grep -v "^#else" |
+ grep -v "^#endif" |
if [ "$IS_INCLUDE" = "Y" ]
- then cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
- grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
- else cat "$FILE" >/tmp/$$a
- fi
+ then # remove struct references
+# sed 's/->[a-zA-Z0-9_\.]*//g'
+ cat
+ else cat
+ fi >/tmp/$$a
# set up initial file contents
grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' \