From c8152a20161ba1ca0a09499d510fe44b816d589d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 2 Mar 2006 22:11:16 +0000 Subject: [PATCH] Php5 exception support from Ollie Betts git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8930 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/exception.i | 7 +++++-- 1 file 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