diff options
author | Olly Betts <olly@survex.com> | 2022-09-28 18:59:31 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2022-09-28 18:59:31 +1300 |
commit | 55c95d475cc0deebdc35564aa39875fe03d72c35 (patch) | |
tree | f7f676041bc28ba489322935daa28990bdb059ec | |
parent | 91887a10cd6450b5def7a9cb4845533114c7f47b (diff) | |
download | swig-55c95d475cc0deebdc35564aa39875fe03d72c35.tar.gz |
[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.
-rw-r--r-- | Source/Modules/php.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 964456c08..37a58d752 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -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"); |