Improve method of avoiding fcinfo compile errors.
Fix pgrminclude C comment marker.
This commit is contained in:
parent
e4df037330
commit
418d04ea73
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue