diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/libpq/hba.h | 2 | ||||
-rwxr-xr-x | src/tools/pginclude/pgcompinclude | 16 | ||||
-rwxr-xr-x | src/tools/pginclude/pgdefine | 3 | ||||
-rwxr-xr-x | src/tools/pginclude/pgrminclude | 15 |
4 files changed, 23 insertions, 13 deletions
diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h index 489e62ce8d7..c5a77c2a5af 100644 --- a/src/include/libpq/hba.h +++ b/src/include/libpq/hba.h @@ -11,7 +11,7 @@ #ifndef HBA_H #define HBA_H -#include "libpq/pqcomm.h" /* pgrminclude remove */ /* needed for NetBSD */ +#include "libpq/pqcomm.h" /* pgrminclude ignore */ /* needed for NetBSD */ #include "nodes/pg_list.h" diff --git a/src/tools/pginclude/pgcompinclude b/src/tools/pginclude/pgcompinclude index 89768335e64..afc079a3103 100755 --- a/src/tools/pginclude/pgcompinclude +++ b/src/tools/pginclude/pgcompinclude @@ -13,14 +13,20 @@ find . \( -name .git -a -prune \) -o -name '*.h' -type f -print | while read FIL do sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a echo "#include \"postgres.h\"" >/tmp/$$.c - echo "#include \"/tmp/$$a\"" >>/tmp/$$.c + # supress fcinfo errors - echo "#undef PG_GETARG_DATUM" >>/tmp/$$.c - echo "#define PG_GETARG_DATUM(n)" >>/tmp/$$.c - echo "void include_test(void);" >>/tmp/$$.c - echo "void include_test() {" >>/tmp/$$.c + echo "struct {Datum arg[1];} *fcinfo;" >>/tmp/$$.c + + echo "#include \"/tmp/$$a\"" >>/tmp/$$.c + + echo "Datum include_test(void);" >>/tmp/$$.c + echo "Datum include_test() {" >>/tmp/$$.c + pgdefine "$FILE" >>/tmp/$$.c + + echo "return (Datum)0;" >>/tmp/$$.c echo "}" >>/tmp/$$.c + # Use -O1 to get warnings only generated by optimization, # but -O2 is too slow. cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \ diff --git a/src/tools/pginclude/pgdefine b/src/tools/pginclude/pgdefine index 0284307381c..242d035a778 100755 --- a/src/tools/pginclude/pgdefine +++ b/src/tools/pginclude/pgdefine @@ -18,5 +18,8 @@ do sed 's/([a-zA-Z0-9_ ]*,/(0,/g' | sed 's/,[a-zA-Z0-9_ ]*,/,0,/g' | sed 's/,[a-zA-Z0-9_ ]*)/,0)/g' | + # do not cast 'return' macros as (void) + sed 's/(=void)\(.*return\)/\1/g' | + sed 's/(=void)\(.*RETURN\)/\1/g' | sed 's/(=void)/(void)/g' done diff --git a/src/tools/pginclude/pgrminclude b/src/tools/pginclude/pgrminclude index f162140379a..2ac9c78880f 100755 --- a/src/tools/pginclude/pgrminclude +++ b/src/tools/pginclude/pgrminclude @@ -68,19 +68,20 @@ compile_file() { if [ "$IS_INCLUDE" = "Y" ] then echo "#include \"postgres.h\"" >/tmp/$$.c + # supress fcinfo errors + echo "struct {Datum arg[1];} *fcinfo;" >>/tmp/$$.c else >/tmp/$$.c fi echo "#include \"/tmp/$$b\"" >>/tmp/$$.c - # supress fcinfo errors - echo "#undef PG_GETARG_DATUM" >>/tmp/$$.c - echo "#define PG_GETARG_DATUM(n)" >>/tmp/$$.c - echo "void include_test(void);" >>/tmp/$$.c - echo "void include_test() {" >>/tmp/$$.c + if [ "$IS_INCLUDE" = "Y" ] - then pgdefine "$FILE" >>/tmp/$$.c + then echo "Datum include_test(void);" >>/tmp/$$.c + echo "Datum include_test() {" >>/tmp/$$.c + pgdefine "$FILE" >>/tmp/$$.c + echo "return (Datum)0;" >>/tmp/$$.c + echo "}" >>/tmp/$$.c fi - echo "}" >>/tmp/$$.c # Use -O1 to get warnings only generated by optimization, # but -O2 is too slow. |