aboutsummaryrefslogtreecommitdiff
path: root/Lib/exception.i
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2016-11-30 13:05:59 +1300
committerOlly Betts <olly@survex.com>2016-11-30 13:05:59 +1300
commit1169874f598d3b4078ec34a8001330838f83c7f7 (patch)
treebea5491420cfe54b5b279d40599861d5d1588ee9 /Lib/exception.i
parentbb98147965083798815ab938ec369c6a17abd9fc (diff)
downloadswig-1169874f598d3b4078ec34a8001330838f83c7f7.tar.gz
[PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use -php7 to specify you want PHP7 compatible wrappers. Fixes https://github.com/swig/swig/issues/571
Diffstat (limited to 'Lib/exception.i')
-rw-r--r--Lib/exception.i9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/exception.i b/Lib/exception.i
index c8509987b..da0d56cdd 100644
--- a/Lib/exception.i
+++ b/Lib/exception.i
@@ -12,13 +12,20 @@
%insert("runtime") "swigerrors.swg"
-#ifdef SWIGPHP
+#ifdef SWIGPHP5
%{
#include "zend_exceptions.h"
#define SWIG_exception(code, msg) do { zend_throw_exception(NULL, (char*)msg, code TSRMLS_CC); goto thrown; } while (0)
%}
#endif
+#ifdef SWIGPHP7
+%{
+#include "zend_exceptions.h"
+#define SWIG_exception(code, msg) do { zend_throw_exception(NULL, (char*)msg, code); goto thrown; } while (0)
+%}
+#endif
+
#ifdef SWIGGUILE
%{
SWIGINTERN void SWIG_exception_ (int code, const char *msg,