[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 #745 Fixes #1739
This commit is contained in:
parent
eb13261950
commit
aee380ce82
3 changed files with 6 additions and 2 deletions
|
|
@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
||||||
Version 4.1.0 (in progress)
|
Version 4.1.0 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2022-02-01: davidcl
|
||||||
|
[Scilab] #745 use SWIG_<module>_Init() as a C module init function.
|
||||||
|
|
||||||
2022-02-01: olly
|
2022-02-01: olly
|
||||||
[OCaml] #2083 Fix to work when CAML_SAFE_STRING is on, which it is
|
[OCaml] #2083 Fix to work when CAML_SAFE_STRING is on, which it is
|
||||||
by default in recent Ocaml releases.
|
by default in recent Ocaml releases.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ SWIG_Scilab_TypeQuery(const char *name) {
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
int <module>_Init(SWIG_GatewayParameters) {
|
int SWIG_<module>_Init(SWIG_GatewayParameters) {
|
||||||
SWIG_InitializeModule(NULL);
|
SWIG_InitializeModule(NULL);
|
||||||
SWIG_CreateScilabVariables(pvApiCtx);
|
SWIG_CreateScilabVariables(pvApiCtx);
|
||||||
swig_module_initialized = 1;
|
swig_module_initialized = 1;
|
||||||
|
|
|
||||||
|
|
@ -228,9 +228,10 @@ public:
|
||||||
|
|
||||||
// Module initialization function
|
// Module initialization function
|
||||||
String *gatewayInitFunctionName = NewStringf("%s_Init", gatewayName);
|
String *gatewayInitFunctionName = NewStringf("%s_Init", gatewayName);
|
||||||
|
String *wrapperInitFunctionName = NewStringf("SWIG_%s_Init", gatewayName);
|
||||||
|
|
||||||
/* Add initialization function to builder table */
|
/* Add initialization function to builder table */
|
||||||
addFunctionToScilab(gatewayInitFunctionName, gatewayInitFunctionName);
|
addFunctionToScilab(gatewayInitFunctionName, wrapperInitFunctionName);
|
||||||
|
|
||||||
// Add helper functions to builder table
|
// Add helper functions to builder table
|
||||||
addHelperFunctions();
|
addHelperFunctions();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue