From f77113ea71e2373ae655c8187c71069a0ee82904 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 26 Mar 2021 13:58:02 +1300 Subject: [PATCH] php: Eliminate SWIG_ZEND_NAMED_FE It existed to work around const-correctness issues in older versions of PHP's C API. It's conceivable user code might be using it, but unlikely and the switch to creating classes via the API is a natural time for a compatibility break. --- Lib/php/phprun.swg | 4 ---- Source/Modules/php.cxx | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Lib/php/phprun.swg b/Lib/php/phprun.swg index 76eee87da..bec32df61 100644 --- a/Lib/php/phprun.swg +++ b/Lib/php/phprun.swg @@ -19,10 +19,6 @@ extern "C" { #include "ext/standard/php_string.h" #include /* for abort(), used in generated code. */ -/* This indirection is to work around const correctness issues in older PHP. - * FIXME: Remove for PHP7? Or might user code be using it? */ -#define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A) - #define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) #define SWIG_LONG_CONSTANT(N, V) REGISTER_LONG_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) #define SWIG_DOUBLE_CONSTANT(N, V) REGISTER_DOUBLE_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 51ff6b76f..0ea404209 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -739,8 +739,8 @@ public: } Printv(f_begin, s_vdecl, s_wrappers, NIL); Printv(f_begin, s_arginfo, "\n\n", all_cs_entry, "\n\n", s_entry, - " SWIG_ZEND_NAMED_FE(swig_", module, "_alter_newobject,_wrap_swig_", module, "_alter_newobject,swig_arginfo_2)\n" - " SWIG_ZEND_NAMED_FE(swig_", module, "_get_newobject,_wrap_swig_", module, "_get_newobject,swig_arginfo_1)\n" + " ZEND_NAMED_FE(swig_", module, "_alter_newobject,_wrap_swig_", module, "_alter_newobject,swig_arginfo_2)\n" + " ZEND_NAMED_FE(swig_", module, "_get_newobject,_wrap_swig_", module, "_get_newobject,swig_arginfo_1)\n" " ZEND_FE_END\n};\n\n", NIL); Printv(f_begin, s_init, NIL); Delete(s_header); @@ -840,7 +840,7 @@ public: Printf(all_cs_entry, " PHP_ME(%s,%s,swig_arginfo_%s,%s)\n", cname, fname, arginfo_code, modes); } else { if (overload) - Printf(s, " SWIG_ZEND_NAMED_FE(%(lower)s,%s,swig_arginfo_%s)\n", Getattr(n, "sym:name"), fname, arginfo_code); + Printf(s, " ZEND_NAMED_FE(%(lower)s,%s,swig_arginfo_%s)\n", Getattr(n, "sym:name"), fname, arginfo_code); else Printf(s, " PHP_FE(%s,swig_arginfo_%s)\n", fname, arginfo_code); }