From f479cd8c3110423fb10763eb029c0d95af10b342 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 1 Nov 2003 00:47:14 +0000 Subject: [PATCH] Delegate register function name mangling. Mangled with the module name to prevent name clashes when using more than 1 module. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5223 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/csharp/csharphead.swg | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/SWIG/Lib/csharp/csharphead.swg b/SWIG/Lib/csharp/csharphead.swg index 1b363a87f..63461909c 100644 --- a/SWIG/Lib/csharp/csharphead.swg +++ b/SWIG/Lib/csharp/csharphead.swg @@ -56,11 +56,11 @@ void SWIG_CSharpThrowException(SWIG_CSharpExceptionCodes code, const char *msg) #endif %} -%{ +%insert(runtime) %{ #ifdef __cplusplus extern "C" #endif -DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks(SWIG_CSharpExceptionCallback_t systemException, +DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module(SWIG_CSharpExceptionCallback_t systemException, SWIG_CSharpExceptionCallback_t outOfMemory, SWIG_CSharpExceptionCallback_t indexOutOfRange, SWIG_CSharpExceptionCallback_t divideByZero, @@ -87,8 +87,8 @@ DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks(SWIG_CSharpExceptionCa static SWIGExceptionDelegate argumentOutOfRangeDelegate = new SWIGExceptionDelegate(ThrowArgumentOutOfRangeException); static SWIGExceptionDelegate nullReferenceDelegate = new SWIGExceptionDelegate(ThrowNullReferenceException); - [DllImport("$module", EntryPoint="SWIGRegisterExceptionCallbacks")] - public static extern void SWIGRegisterExceptionCallbacks( + [DllImport("$module", EntryPoint="SWIGRegisterExceptionCallbacks_$module")] + public static extern void SWIGRegisterExceptionCallbacks_$module( SWIGExceptionDelegate systemExceptionDelegate, SWIGExceptionDelegate outOfMemoryDelegate, SWIGExceptionDelegate indexOutOfRangeDelegate, @@ -121,7 +121,7 @@ DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks(SWIG_CSharpExceptionCa } static SWIGExceptionHelper() { - SWIGRegisterExceptionCallbacks(systemDelegate, outOfMemoryDelegate, indexOutOfRangeDelegate, divideByZeroDelegate, argumentOutOfRangeDelegate, nullReferenceDelegate); + SWIGRegisterExceptionCallbacks_$module(systemDelegate, outOfMemoryDelegate, indexOutOfRangeDelegate, divideByZeroDelegate, argumentOutOfRangeDelegate, nullReferenceDelegate); } } @@ -140,26 +140,26 @@ static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL; public delegate string SWIGStringDelegate(string message); static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); - [DllImport("$module", EntryPoint="SWIGRegisterStringCallback")] - public static extern void SWIGRegisterStringCallback(SWIGStringDelegate stringDelegate); + [DllImport("$module", EntryPoint="SWIGRegisterStringCallback_$module")] + public static extern void SWIGRegisterStringCallback_$module(SWIGStringDelegate stringDelegate); static string CreateString(string cString) { return cString; } static SWIGStringHelper() { - SWIGRegisterStringCallback(stringDelegate); + SWIGRegisterStringCallback_$module(stringDelegate); } } static SWIGStringHelper stringHelper = new SWIGStringHelper(); %} -%{ +%insert(runtime) %{ #ifdef __cplusplus extern "C" #endif -DllExport void SWIGSTDCALL SWIGRegisterStringCallback(SWIG_CSharpStringHelperCallback callback) { +DllExport void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpStringHelperCallback callback) { SWIG_csharp_string_callback = callback; } %}