[php] Adapt swig_ptr_cast_object for PHP 8.2

The required return type has changed from int to an enum, which
gives a compiler warning when we assign a function pointer.
This commit is contained in:
Olly Betts 2022-09-28 18:59:31 +13:00
commit 55c95d475c

View file

@ -148,6 +148,8 @@ static void SwigPHP_emit_pointer_type_registrations() {
Printf(s_wrappers, "/* Implement __toString equivalent, since that worked for the old-style resource wrapped pointers. */\n");
Append(s_wrappers, "#if PHP_MAJOR_VERSION < 8\n");
Printf(s_wrappers, "static int swig_ptr_cast_object(zval *z, zval *retval, int type) {\n");
Append(s_wrappers, "#elif PHP_MAJOR_VERSION > 8 || PHP_MINOR_VERSION >= 2\n");
Printf(s_wrappers, "static ZEND_RESULT_CODE swig_ptr_cast_object(zend_object *zobj, zval *retval, int type) {\n");
Append(s_wrappers, "#else\n");
Printf(s_wrappers, "static int swig_ptr_cast_object(zend_object *zobj, zval *retval, int type) {\n");
Append(s_wrappers, "#endif\n");