Skip to content

Commit aee380c

Browse files
davidclojwb
authored andcommitted
[scilab] Name init function name to avoid collision
Use SWIG_<module>_Init() function to init the module rather than <module>_Init() as the latter can collide with a function being wrapped. Fixes swig#745 Fixes swig#1739
1 parent eb13261 commit aee380c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGES.current

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
77
Version 4.1.0 (in progress)
88
===========================
99

10+
2022-02-01: davidcl
11+
[Scilab] #745 use SWIG_<module>_Init() as a C module init function.
12+
1013
2022-02-01: olly
1114
[OCaml] #2083 Fix to work when CAML_SAFE_STRING is on, which it is
1215
by default in recent Ocaml releases.

Lib/scilab/sciruntime.swg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SWIG_Scilab_TypeQuery(const char *name) {
4040
#ifdef __cplusplus
4141
extern "C"
4242
#endif
43-
int <module>_Init(SWIG_GatewayParameters) {
43+
int SWIG_<module>_Init(SWIG_GatewayParameters) {
4444
SWIG_InitializeModule(NULL);
4545
SWIG_CreateScilabVariables(pvApiCtx);
4646
swig_module_initialized = 1;

Source/Modules/scilab.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ class SCILAB:public Language {
228228

229229
// Module initialization function
230230
String *gatewayInitFunctionName = NewStringf("%s_Init", gatewayName);
231+
String *wrapperInitFunctionName = NewStringf("SWIG_%s_Init", gatewayName);
231232

232233
/* Add initialization function to builder table */
233-
addFunctionToScilab(gatewayInitFunctionName, gatewayInitFunctionName);
234+
addFunctionToScilab(gatewayInitFunctionName, wrapperInitFunctionName);
234235

235236
// Add helper functions to builder table
236237
addHelperFunctions();

0 commit comments

Comments
 (0)