From 1e6be5aaf5675e43c622ce0860a2b9688bb3bee3 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Mon, 19 Feb 2001 08:14:45 +0000 Subject: [PATCH] Fix incompatibility with PostgreSQL CVS. We now perform a check whether we need to include to succesfully compile. PR: #9328 --- ext/pgsql/config.m4 | 19 +++++++++++++++++++ ext/pgsql/php_pgsql.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index bedf744837..fee81e8e0f 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -23,6 +23,25 @@ if test "$PHP_PGSQL" != "no"; then PGSQL_INCLUDE="-I$PGSQL_INCDIR" + AC_CACHE_CHECK([whether PostgreSQL needs postgres.h], ac_cv_php_pgsql_postgres_h,[ + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $PGSQL_INCLUDE" + AC_TRY_COMPILE([ +#include +],[ + Oid x = InvalidOid; +],[ + ac_cv_php_pgsql_postgres_h=no +],[ + ac_cv_php_pgsql_postgres_h=yes +]) + CPPFLAGS=$old_CPPFLAGS +]) + + if test "$ac_cv_php_pgsql_postgres_h" = "yes"; then + AC_DEFINE(PHP_PGSQL_NEEDS_POSTGRES_H, 1, [whether pgsql needs postgres.h]) + fi + PGSQL_LIBDIR=$PGSQL_DIR/lib test -d $PGSQL_DIR/lib/pgsql && PGSQL_LIBDIR=$PGSQL_DIR/lib/pgsql diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index e53670a1af..22ccfe2c75 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -29,7 +29,9 @@ extern zend_module_entry pgsql_module_entry; #ifdef PHP_PGSQL_PRIVATE #undef SOCKET_SIZE_TYPE +#ifdef PHP_PGSQL_NEEDS_POSTGRES_H #include +#endif #include #ifdef PHP_WIN32 -- 2.40.0