]> granicus.if.org Git - php/commitdiff
Simpler fix for the InvalidOid thing by Tom Lane.
authorSascha Schumann <sas@php.net>
Mon, 19 Feb 2001 16:31:17 +0000 (16:31 +0000)
committerSascha Schumann <sas@php.net>
Mon, 19 Feb 2001 16:31:17 +0000 (16:31 +0000)
He assured me that InvalidOid has always expanded to (Oid) 0, so this
should be safe.

ext/pgsql/config.m4
ext/pgsql/pgsql.c
ext/pgsql/php_pgsql.h

index fee81e8e0fc6b21e166f6dfd0bace1d7ed638807..3c7c4d19e0d50be1035e3c6feb327db448896cf8 100644 (file)
@@ -22,26 +22,6 @@ if test "$PHP_PGSQL" != "no"; then
   fi
 
   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 <libpq-fe.h>
-],[
-  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
 
index 25b3a3661972e10ba114062b1eb7c0fb029028aa..abfd1d552c09792c6fdb22a5ec78a3263902433d 100644 (file)
@@ -31,6 +31,9 @@
 
 #if HAVE_PGSQL
 
+#ifndef InvalidOid
+#define InvalidOid ((Oid) 0)
+#endif
 
 #define PGSQL_ASSOC            1<<0
 #define PGSQL_NUM              1<<1
index 22ccfe2c75b0dc9783498ba1e673127485c76c28..25f9b7d9defbe1a78b8de75c99f620af9c3cfdae 100644 (file)
@@ -29,9 +29,6 @@ extern zend_module_entry pgsql_module_entry;
 
 #ifdef PHP_PGSQL_PRIVATE
 #undef SOCKET_SIZE_TYPE
-#ifdef PHP_PGSQL_NEEDS_POSTGRES_H
-#include <postgres.h>
-#endif
 #include <libpq-fe.h>
 
 #ifdef PHP_WIN32