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
This commit is contained in:
parent
97ed6ef9f3
commit
c8b6a0687c
1 changed files with 6 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue