From 09bd1b834d2a7486d67def0fba2bb6e62d82dde7 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@8930 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/exception.i | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SWIG/Lib/exception.i b/SWIG/Lib/exception.i index b105ee433..b6df57046 100644 --- a/SWIG/Lib/exception.i +++ b/SWIG/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