* Change the builder filename to match the loader filename
* Mark extern functions with SWIGEXPORT
* Fix bug: builder.sce not generated if with '-scilab -builder' option
Fixes#1853
Exit() is a wrapper for exit() by default, but SetExitHandler() allows
specifying a function to call instead.
This means that failures within DOH (e.g. Malloc() failing due to lack
of memory) will now perform cleanup such as removing output files.
This commit also cleans up exit statuses so SWIG should now reliably
exit with status 0 if the run was successful and status 1 if there was
an error (or a warning and -Werror was in effect).
Previously in some situations SWIG would try to exit with the status set
to the number of errors encountered, but that's problematic - for
example if there were 256 errors this would result in exit status 0 on
most platforms. Also some error statuses have special meanings e.g.
those defined by <sysexits.h>.
Also SWIG/Javascript tried to exit with status -1 in a few places (which
typically results in exit status 255).
This commit handles multi-version support at runtime, it
fixes:
* 5.5.2 - with cutted long identifier name
* 6.0.0 - with full string identifier
* 6.1.0 - with 1 or 0 output argument
It also improves the codebase by:
* Using `Char(X)` instead of `DohCheck(X)` and `Data(X)`
* Using `Len(X)` instead of `strlen()`
* Correctly detecting old Scilab versions
Use SWIG_<module>_Init() function to init the module rather than
<module>_Init() as the latter can collide with a function being wrapped.
Fixes#745Fixes#1739
These were officially deprecated in 2001, and attempts to use them have
resulted in a warning (including a pointer to what to update them to)
for most if not all of that time.
Fixes#1984
With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
Signed-off-by: Simon Marchetto <simon.marchetto@scilab-enterprises.com>