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

Commit418d04e

Browse files
committed
Improve method of avoiding fcinfo compile errors.
Fix pgrminclude C comment marker.
1 parente4df037 commit418d04e

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

‎src/include/libpq/hba.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#ifndefHBA_H
1212
#defineHBA_H
1313

14-
#include"libpq/pqcomm.h"/* pgrmincluderemove *//* needed for NetBSD */
14+
#include"libpq/pqcomm.h"/* pgrmincludeignore *//* needed for NetBSD */
1515
#include"nodes/pg_list.h"
1616

1717

‎src/tools/pginclude/pgcompinclude

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ find . \( -name .git -a -prune \) -o -name '*.h' -type f -print | while read FIL
1313
do
1414
sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
1515
echo "#include \"postgres.h\"" >/tmp/$$.c
16-
echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
16+
1717
# supress fcinfo errors
18-
echo "#undef PG_GETARG_DATUM" >>/tmp/$$.c
19-
echo "#define PG_GETARG_DATUM(n)" >>/tmp/$$.c
20-
echo "void include_test(void);" >>/tmp/$$.c
21-
echo "void include_test() {" >>/tmp/$$.c
18+
echo "struct {Datum arg[1];} *fcinfo;" >>/tmp/$$.c
19+
20+
echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
21+
22+
echo "Datum include_test(void);" >>/tmp/$$.c
23+
echo "Datum include_test() {" >>/tmp/$$.c
24+
2225
pgdefine "$FILE" >>/tmp/$$.c
26+
27+
echo "return (Datum)0;" >>/tmp/$$.c
2328
echo "}" >>/tmp/$$.c
29+
2430
# Use -O1 to get warnings only generated by optimization,
2531
# but -O2 is too slow.
2632
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \

‎src/tools/pginclude/pgdefine

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ do
1818
sed 's/([a-zA-Z0-9_ ]*,/(0,/g' |
1919
sed 's/,[a-zA-Z0-9_ ]*,/,0,/g' |
2020
sed 's/,[a-zA-Z0-9_ ]*)/,0)/g' |
21+
# do not cast 'return' macros as (void)
22+
sed 's/(=void)\(.*return\)/\1/g' |
23+
sed 's/(=void)\(.*RETURN\)/\1/g' |
2124
sed 's/(=void)/(void)/g'
2225
done

‎src/tools/pginclude/pgrminclude

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,20 @@ compile_file() {
6868

6969
if [ "$IS_INCLUDE" = "Y" ]
7070
thenecho "#include \"postgres.h\"" >/tmp/$$.c
71+
# supress fcinfo errors
72+
echo "struct {Datum arg[1];} *fcinfo;" >>/tmp/$$.c
7173
else>/tmp/$$.c
7274
fi
7375

7476
echo "#include \"/tmp/$$b\"" >>/tmp/$$.c
75-
# supress fcinfo errors
76-
echo "#undef PG_GETARG_DATUM" >>/tmp/$$.c
77-
echo "#define PG_GETARG_DATUM(n)" >>/tmp/$$.c
78-
echo "void include_test(void);" >>/tmp/$$.c
79-
echo "void include_test() {" >>/tmp/$$.c
77+
8078
if [ "$IS_INCLUDE" = "Y" ]
81-
thenpgdefine "$FILE" >>/tmp/$$.c
79+
thenecho "Datum include_test(void);" >>/tmp/$$.c
80+
echo "Datum include_test() {" >>/tmp/$$.c
81+
pgdefine "$FILE" >>/tmp/$$.c
82+
echo "return (Datum)0;" >>/tmp/$$.c
83+
echo "}" >>/tmp/$$.c
8284
fi
83-
echo "}" >>/tmp/$$.c
8485

8586
# Use -O1 to get warnings only generated by optimization,
8687
# but -O2 is too slow.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp