X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqtypes.c;h=7092c57254d9d8a32027b910727de24b42ef7988;hp=db2c44e0d77b1f5ae44ae4571f9b30e1b6ce995a;hb=cd5d3cdafda1f9e9fe120c9eaf1269fdc577f04d;hpb=5aa292d5bc46cd8fe266d682397dba19dc1e1d36 diff --git a/src/php_pqtypes.c b/src/php_pqtypes.c index db2c44e..7092c57 100644 --- a/src/php_pqtypes.c +++ b/src/php_pqtypes.c @@ -225,7 +225,9 @@ static PHP_METHOD(pqtypes, __construct) { "from pg_type t join pg_namespace n on t.typnamespace=n.oid " \ "where typisdefined " \ "and typrelid=0" -#define PHP_PQ_OID_TEXT 25 +#ifndef PHP_PQ_OID_TEXT +# define PHP_PQ_OID_TEXT 25 +#endif ZEND_BEGIN_ARG_INFO_EX(ai_pqtypes_refresh, 0, 0, 0) ZEND_ARG_ARRAY_INFO(0, namespaces, 1) @@ -338,6 +340,15 @@ PHP_MINIT_FUNCTION(pqtypes) ph.read = php_pqtypes_object_read_connection; zend_hash_add(&php_pqtypes_object_prophandlers, "connection", sizeof("connection"), (void *) &ph, sizeof(ph), NULL); +#ifdef HAVE_PHP_PQ_TYPE_H +# undef PHP_PQ_TYPE +# define PHP_PQ_TYPE(name, oid) zend_declare_class_constant_long(php_pqtypes_class_entry, ZEND_STRL(name), oid TSRMLS_CC); +# include "php_pq_type.h" + zend_declare_class_constant_bool(php_pqtypes_class_entry, ZEND_STRL("DEFINED"), 1 TSRMLS_CC); +#else + zend_declare_class_constant_bool(php_pqtypes_class_entry, ZEND_STRL("DEFINED"), 0 TSRMLS_CC); +#endif + return SUCCESS; }