summaryrefslogtreecommitdiff
path: root/Lib/exception.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2006-03-02 22:11:16 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2006-03-02 22:11:16 +0000
commitc8152a20161ba1ca0a09499d510fe44b816d589d (patch)
treeff9035a7b9c9f10b7f92eb4c5e64f2d0983d80fe /Lib/exception.i
parent2a26e53f7548401ce675a622674278bf6948da89 (diff)
downloadswig-c8152a20161ba1ca0a09499d510fe44b816d589d.tar.gz
Php5 exception support from Ollie Betts
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8930 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/exception.i')
-rw-r--r--Lib/exception.i7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/exception.i b/Lib/exception.i
index b105ee433..b6df57046 100644
--- a/Lib/exception.i
+++ b/Lib/exception.i
@@ -15,8 +15,11 @@
#ifdef SWIGPHP4
%{
-/* We should make use of "code" if we can */
-#define SWIG_exception(code, msg) { zend_error(E_ERROR, msg); }
+#if PHP_MAJOR_VERSION < 5
+# define SWIG_exception(code, msg) { zend_error(E_ERROR, msg); }
+#else
+# define SWIG_exception(code, msg) { zend_throw_exception(NULL, msg, code TSRMLS_CC); }
+#endif
%}
#endif