Commit ac5f11e0 authored by Bruce Momjian's avatar Bruce Momjian

Fix #if blocks.

parent 00eb036c
...@@ -11,19 +11,18 @@ grep -v '\./pg_config.h' | ...@@ -11,19 +11,18 @@ grep -v '\./pg_config.h' |
grep -v '\./c.h' | grep -v '\./c.h' |
while read FILE while read FILE
do 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 ] if [ `expr $FILE : '.*\.h$'` -ne 0 ]
then IS_INCLUDE="Y" then IS_INCLUDE="Y"
else IS_INCLUDE="N" else IS_INCLUDE="N"
fi fi
# loop through all includes # loop through all includes
cat "$FILE" | grep "^#include" | cat "$FILE" |
grep "^#include\>" |
grep -v '/\* *pgrminclude *ignore *\*/' | grep -v '/\* *pgrminclude *ignore *\*/' |
sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' | sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
grep -v 'parser/kwlist\.h' |
grep -v '\.c$' |
while read INCLUDE while read INCLUDE
do do
if [ "$1" = "-v" ] if [ "$1" = "-v" ]
...@@ -43,12 +42,18 @@ do ...@@ -43,12 +42,18 @@ do
grep -A1 '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" | grep -A1 '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" |
egrep -q '^#else|^#endif' && continue 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" ] if [ "$IS_INCLUDE" = "Y" ]
then cat "$FILE" | grep -v "^#if" | grep -v "^#else" | then # remove struct references
grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a # sed 's/->[a-zA-Z0-9_\.]*//g'
else cat "$FILE" >/tmp/$$a cat
fi else cat
fi >/tmp/$$a
# set up initial file contents # set up initial file contents
grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' \ grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment