From a8489a01a43cf65d83d6c74839d2ee967007aaea Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 24 Sep 2020 16:10:21 +0200 Subject: [PATCH] check for new connection status constants in pg-10+ --- config9.m4 | 3 +++ src/php_pqconn.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/config9.m4 b/config9.m4 index 8064df9..9782d18 100644 --- a/config9.m4 +++ b/config9.m4 @@ -68,6 +68,9 @@ if test "$PHP_PQ" != "no"; then PQ_CHECK_CONST(PGRES_SINGLE_TUPLE) PQ_CHECK_CONST(PGRES_COPY_BOTH) + PQ_CHECK_CONST(CONNECTION_CHECK_WRITABLE) + PQ_CHECK_CONST(CONNECTION_CONSUME) + PQ_CHECK_CONST(CONNECTION_GSS_STARTUP) dnl dnl PQ_CHECK_FUNC(sym, fail-hard) diff --git a/src/php_pqconn.c b/src/php_pqconn.c index fd5ec64..3a44a95 100644 --- a/src/php_pqconn.c +++ b/src/php_pqconn.c @@ -2139,6 +2139,15 @@ PHP_MINIT_FUNCTION(pqconn) zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("AUTH_OK"), CONNECTION_AUTH_OK); zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("SSL_STARTUP"), CONNECTION_SSL_STARTUP); zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("SETENV"), CONNECTION_SETENV); +#ifdef HAVE_CONNECTION_CHECK_WRITABLE + zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("CHECK_WRITABLE"), CONNECTION_CHECK_WRITABLE); +#endif +#ifdef HAVE_CONNECTION_CONSUME + zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("CONSUME"), CONNECTION_CONSUME); +#endif +#ifdef HAVE_CONNECTION_GSS_STARTUP + zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("GSS_STARTUP"), CONNECTION_GSS_STARTUP); +#endif zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("TRANS_IDLE"), PQTRANS_IDLE); zend_declare_class_constant_long(php_pqconn_class_entry, ZEND_STRL("TRANS_ACTIVE"), PQTRANS_ACTIVE);