X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqtypes.c;h=7092c57254d9d8a32027b910727de24b42ef7988;hp=8995f26a71a5147d5fab0b55f9071b0974befc1b;hb=cd5d3cdafda1f9e9fe120c9eaf1269fdc577f04d;hpb=6c838021951716e5b37a0c891cd40c669268de8c diff --git a/src/php_pqtypes.c b/src/php_pqtypes.c index 8995f26..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) @@ -324,6 +326,7 @@ PHP_MINIT_FUNCTION(pqtypes) php_pqtypes_object_handlers.write_property = php_pq_object_write_prop; php_pqtypes_object_handlers.clone_obj = NULL; php_pqtypes_object_handlers.get_property_ptr_ptr = NULL; + php_pqtypes_object_handlers.get_gc = NULL; php_pqtypes_object_handlers.get_properties = php_pq_object_properties; php_pqtypes_object_handlers.get_debug_info = php_pq_object_debug_info; php_pqtypes_object_handlers.has_dimension = php_pqtypes_object_has_dimension; @@ -337,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; }