From 62383e4cec0e908b6636d7e8694e9f2b8b41ed5c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 3 Mar 2006 22:39:54 +0000 Subject: [PATCH] remove unused warnings with gcc -Wall Add sanity check back in checking that the pending exception count is zero per thread git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8946 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/csharp/csharphead.swg | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SWIG/Lib/csharp/csharphead.swg b/SWIG/Lib/csharp/csharphead.swg index 8845780a1..a4b2fa34c 100644 --- a/SWIG/Lib/csharp/csharphead.swg +++ b/SWIG/Lib/csharp/csharphead.swg @@ -64,7 +64,7 @@ static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { { SWIG_CSharpArgumentOutOfRangeException, NULL }, }; -static void SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { +static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { callback = SWIG_csharp_exceptions[code].callback; @@ -72,7 +72,7 @@ static void SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const callback(msg); } -static void SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { +static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { callback = SWIG_csharp_exceptions_argument[code].callback; @@ -244,6 +244,8 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( } public static void Set(Exception e) { + if (pendingException != null) + throw new ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); pendingException = e; lock(typeof($imclassname)) { numExceptionsPending++;