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/SWIG@5223 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1788e7a7e3
commit
9506c8c9f7
1 changed files with 10 additions and 10 deletions
|
|
@ -56,11 +56,11 @@ void SWIG_CSharpThrowException(SWIG_CSharpExceptionCodes code, const char *msg)
|
||||||
#endif
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%{
|
%insert(runtime) %{
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#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 outOfMemory,
|
||||||
SWIG_CSharpExceptionCallback_t indexOutOfRange,
|
SWIG_CSharpExceptionCallback_t indexOutOfRange,
|
||||||
SWIG_CSharpExceptionCallback_t divideByZero,
|
SWIG_CSharpExceptionCallback_t divideByZero,
|
||||||
|
|
@ -87,8 +87,8 @@ DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks(SWIG_CSharpExceptionCa
|
||||||
static SWIGExceptionDelegate argumentOutOfRangeDelegate = new SWIGExceptionDelegate(ThrowArgumentOutOfRangeException);
|
static SWIGExceptionDelegate argumentOutOfRangeDelegate = new SWIGExceptionDelegate(ThrowArgumentOutOfRangeException);
|
||||||
static SWIGExceptionDelegate nullReferenceDelegate = new SWIGExceptionDelegate(ThrowNullReferenceException);
|
static SWIGExceptionDelegate nullReferenceDelegate = new SWIGExceptionDelegate(ThrowNullReferenceException);
|
||||||
|
|
||||||
[DllImport("$module", EntryPoint="SWIGRegisterExceptionCallbacks")]
|
[DllImport("$module", EntryPoint="SWIGRegisterExceptionCallbacks_$module")]
|
||||||
public static extern void SWIGRegisterExceptionCallbacks(
|
public static extern void SWIGRegisterExceptionCallbacks_$module(
|
||||||
SWIGExceptionDelegate systemExceptionDelegate,
|
SWIGExceptionDelegate systemExceptionDelegate,
|
||||||
SWIGExceptionDelegate outOfMemoryDelegate,
|
SWIGExceptionDelegate outOfMemoryDelegate,
|
||||||
SWIGExceptionDelegate indexOutOfRangeDelegate,
|
SWIGExceptionDelegate indexOutOfRangeDelegate,
|
||||||
|
|
@ -121,7 +121,7 @@ DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks(SWIG_CSharpExceptionCa
|
||||||
}
|
}
|
||||||
|
|
||||||
static SWIGExceptionHelper() {
|
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);
|
public delegate string SWIGStringDelegate(string message);
|
||||||
static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
|
static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
|
||||||
|
|
||||||
[DllImport("$module", EntryPoint="SWIGRegisterStringCallback")]
|
[DllImport("$module", EntryPoint="SWIGRegisterStringCallback_$module")]
|
||||||
public static extern void SWIGRegisterStringCallback(SWIGStringDelegate stringDelegate);
|
public static extern void SWIGRegisterStringCallback_$module(SWIGStringDelegate stringDelegate);
|
||||||
|
|
||||||
static string CreateString(string cString) {
|
static string CreateString(string cString) {
|
||||||
return cString;
|
return cString;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SWIGStringHelper() {
|
static SWIGStringHelper() {
|
||||||
SWIGRegisterStringCallback(stringDelegate);
|
SWIGRegisterStringCallback_$module(stringDelegate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static SWIGStringHelper stringHelper = new SWIGStringHelper();
|
static SWIGStringHelper stringHelper = new SWIGStringHelper();
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%{
|
%insert(runtime) %{
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
DllExport void SWIGSTDCALL SWIGRegisterStringCallback(SWIG_CSharpStringHelperCallback callback) {
|
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpStringHelperCallback callback) {
|
||||||
SWIG_csharp_string_callback = callback;
|
SWIG_csharp_string_callback = callback;
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue