From c8b6a0687cab92968ced53ef179662ee06eadda1 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 15 Feb 2005 22:09:06 +0000 Subject: [PATCH] Fixes to SWIG_exception for C# and Java git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6951 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/exception.i | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lib/exception.i b/Lib/exception.i index 79cd0d7b5..3bd354cd3 100644 --- a/Lib/exception.i +++ b/Lib/exception.i @@ -188,7 +188,7 @@ static void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) { } SWIG_JavaThrowException(jenv, exception_code, msg); } -#define SWIG_exception(code, msg) { SWIG_JavaException(jenv, code, msg); } +#define SWIG_exception(nullreturn, code, msg) { SWIG_JavaException(jenv, code, msg); return nullreturn; } %} #endif // SWIGJAVA @@ -270,8 +270,8 @@ static void SWIG_exception_(int code, const char *msg) { #ifdef SWIGCSHARP %{ -static void SWIG_exception(int code, const char *msg) { - SWIG_CSharpExceptionCodes exception_code = SWIG_CSharpException; +static void SWIG_CSharpException(int code, const char *msg) { + SWIG_CSharpExceptionCodes exception_code = SWIG_CSharpSystemException; switch(code) { case SWIG_MemoryError: exception_code = SWIG_CSharpOutOfMemoryException; @@ -293,11 +293,12 @@ static void SWIG_exception(int code, const char *msg) { case SWIG_SystemError: case SWIG_UnknownError: default: - exception_code = SWIG_CSharpException; + exception_code = SWIG_CSharpSystemException; break; } - SWIG_CSharpThrowException(exception_code, msg); + SWIG_CSharpSetPendingException(exception_code, msg); } +#define SWIG_exception(nullreturn, code, msg) { SWIG_CSharpException(code, msg); return nullreturn; } %} #endif // SWIGCSHARP