Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac5f11e

Browse files
committed
Fix #if blocks.
1 parent00eb036 commitac5f11e

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
thenIS_INCLUDE="Y"
2016
elseIS_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-
thencat "$FILE" | grep -v "^#if" | grep -v "^#else" |
49-
grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
50-
elsecat "$FILE" >/tmp/$$a
51-
fi
52+
then# remove struct references
53+
#sed 's/->[a-zA-Z0-9_\.]*//g'
54+
cat
55+
elsecat
56+
fi >/tmp/$$a
5257

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp