[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:
parent
91887a10cd
commit
55c95d475c
1 changed files with 2 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue