[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:
Clement David 2020-02-27 16:44:09 +01:00 committed by Olly Betts
commit aee380ce82
3 changed files with 6 additions and 2 deletions

View file

@ -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)
===========================
2022-02-01: davidcl
[Scilab] #745 use SWIG_<module>_Init() as a C module init function.
2022-02-01: olly
[OCaml] #2083 Fix to work when CAML_SAFE_STRING is on, which it is
by default in recent Ocaml releases.

View file

@ -40,7 +40,7 @@ SWIG_Scilab_TypeQuery(const char *name) {
#ifdef __cplusplus
extern "C"
#endif
int <module>_Init(SWIG_GatewayParameters) {
int SWIG_<module>_Init(SWIG_GatewayParameters) {
SWIG_InitializeModule(NULL);
SWIG_CreateScilabVariables(pvApiCtx);
swig_module_initialized = 1;

View file

@ -228,9 +228,10 @@ public:
// Module initialization function
String *gatewayInitFunctionName = NewStringf("%s_Init", gatewayName);
String *wrapperInitFunctionName = NewStringf("SWIG_%s_Init", gatewayName);
/* Add initialization function to builder table */
addFunctionToScilab(gatewayInitFunctionName, gatewayInitFunctionName);
addFunctionToScilab(gatewayInitFunctionName, wrapperInitFunctionName);
// Add helper functions to builder table
addHelperFunctions();