Skip to content

Commit ac5f11e

Browse files
committed
Fix #if blocks.
1 parent 00eb036 commit ac5f11e

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/tools/pginclude/pgrminclude

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ grep -v '\./pg_config.h' |
1111
grep -v '\./c.h' |
1212
while read FILE
1313
do
14-
# Skip files with #if and #ifdef blocks because the blocks
15-
# might contain code that is not compiled on this platform.
16-
grep -q '^#if' "$FILE" && continue
17-
1814
if [ `expr $FILE : '.*\.h$'` -ne 0 ]
1915
then IS_INCLUDE="Y"
2016
else IS_INCLUDE="N"
2117
fi
2218

2319
# loop through all includes
24-
cat "$FILE" | grep "^#include" |
20+
cat "$FILE" |
21+
grep "^#include\>" |
2522
grep -v '/\* *pgrminclude *ignore *\*/' |
2623
sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
24+
grep -v 'parser/kwlist\.h' |
25+
grep -v '\.c$' |
2726
while read INCLUDE
2827
do
2928
if [ "$1" = "-v" ]
@@ -43,12 +42,18 @@ do
4342
grep -A1 '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" |
4443
egrep -q '^#else|^#endif' && continue
4544

46-
# remove defines from include files
45+
# Remove all #if and #ifdef blocks because the blocks
46+
# might contain code that is not compiled on this platform.
47+
cat "$FILE" |
48+
grep -v "^#if" |
49+
grep -v "^#else" |
50+
grep -v "^#endif" |
4751
if [ "$IS_INCLUDE" = "Y" ]
48-
then cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
49-
grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
50-
else cat "$FILE" >/tmp/$$a
51-
fi
52+
then # remove struct references
53+
# sed 's/->[a-zA-Z0-9_\.]*//g'
54+
cat
55+
else cat
56+
fi >/tmp/$$a
5257

5358
# set up initial file contents
5459
grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy