diff options
author | Olly Betts <olly@survex.com> | 2023-04-20 13:40:00 +1200 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2023-04-20 13:45:30 +1200 |
commit | 9873ff107af2f9dea05ddb9a48b9c2d7abbfd5dc (patch) | |
tree | 1c58c8e505270638ab329004f50b729305a2b474 /Source | |
parent | a5e025e22afa8c808349a759fdaba3f23ac6bee4 (diff) | |
download | swig-9873ff107af2f9dea05ddb9a48b9c2d7abbfd5dc.tar.gz |
Remove remaining traces of PHP7 support
The bulk of this was already removed in
e3b112c69ceed5c39cb07fa45a3ba62b27712679.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Modules/php.cxx | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 6f326c15b..b272aab81 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -147,19 +147,13 @@ static void SwigPHP_emit_pointer_type_registrations() { Printf(s_wrappers, "}\n\n"); 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"); + Append(s_wrappers, "#if 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"); Printf(s_wrappers, " if (type == IS_STRING) {\n"); - Append(s_wrappers, "#if PHP_MAJOR_VERSION < 8\n"); - Printf(s_wrappers, " swig_object_wrapper *obj = SWIG_Z_FETCH_OBJ_P(z);\n"); - Append(s_wrappers, "#else\n"); Printf(s_wrappers, " swig_object_wrapper *obj = swig_php_fetch_object(zobj);\n"); - Append(s_wrappers, "#endif\n"); Printv(s_wrappers, " ZVAL_NEW_STR(retval, zend_strpprintf(0, \"SWIGPointer(%p,owned=%d)\", obj->ptr, obj->newobject));\n", NIL); Printf(s_wrappers, " return SUCCESS;\n"); Printf(s_wrappers, " }\n"); @@ -2394,16 +2388,10 @@ public: const char *funcname = GetChar(n, "sym:name"); Append(w->code, "{\n"); - Append(w->code, "#if PHP_MAJOR_VERSION < 8\n"); - Printf(w->code, "zval swig_funcname;\n"); - Printf(w->code, "ZVAL_STRINGL(&swig_funcname, \"%s\", %d);\n", funcname, strlen(funcname)); - Printf(w->code, "call_user_function(EG(function_table), &swig_self, &swig_funcname, &swig_zval_result, %d, args);\n", idx); - Append(w->code, "#else\n"); Printf(w->code, "zend_string *swig_funcname = zend_string_init(\"%s\", %d, 0);\n", funcname, strlen(funcname)); Append(w->code, "zend_function *swig_zend_func = zend_std_get_method(&Z_OBJ(swig_self), swig_funcname, NULL);\n"); Append(w->code, "zend_string_release(swig_funcname);\n"); Printf(w->code, "if (swig_zend_func) zend_call_known_instance_method(swig_zend_func, Z_OBJ(swig_self), &swig_zval_result, %d, args);\n", idx); - Append(w->code, "#endif\n"); /* exception handling */ tm = Swig_typemap_lookup("director:except", n, Swig_cresult_name(), 0); |