From: Michael Wallner Date: Tue, 10 Aug 2021 07:36:14 +0000 (+0200) Subject: fix #41: PHP-8.1 compat X-Git-Tag: v2.2.0~5 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=79c6c8eafd9f0fb76557f3297d979ba58ff42a59;p=m6w6%2Fext-pq fix #41: PHP-8.1 compat --- diff --git a/src/php_pq_misc.h b/src/php_pq_misc.h index 1285d8e..34ab6c1 100644 --- a/src/php_pq_misc.h +++ b/src/php_pq_misc.h @@ -92,7 +92,12 @@ extern int php_pq_compare_index(const void *lptr, const void *rptr); SUCCESS == Z_OBJ_HT_P(objval_ptr)->cast_object(objval_ptr, (retval_ptr), (cast_type))) #endif - +#if PHP_VERSION_ID < 80100 +# define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) +# define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) +#endif extern PHP_MINIT_FUNCTION(pq_misc); diff --git a/src/php_pqres.c b/src/php_pqres.c index be3d039..d9b1051 100644 --- a/src/php_pqres.c +++ b/src/php_pqres.c @@ -1146,7 +1146,7 @@ static PHP_METHOD(pqres, fetchAll) { } } -ZEND_BEGIN_ARG_INFO_EX(ai_pqres_count, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_pqres_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO(); static PHP_METHOD(pqres, count) { zend_error_handling zeh; @@ -1194,7 +1194,7 @@ static PHP_METHOD(pqres, desc) { } #if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_INFO_EX(ai_pqres_getIterator, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(ai_pqres_getIterator, 0, 0, Traversable, 0) ZEND_END_ARG_INFO(); static PHP_METHOD(pqres, getIterator) {