Commit Graph

182 Commits

Author SHA1 Message Date
William S Fulton 22a8088a98 Fix -Wunused-variable warning in Lua and Octave wrappers
Add bool output parameter to Swig_overload_dispatch to say when it has
generated code that will use the typecheck typemap code to help Lua and
Octave to not emit unused argv[] arrays.

Alas, resorted to warning suppression for deficient cpp11_initializer_list
typecheck typemap in cpp11_std_initializer_list testcase.
2025-06-23 21:39:49 +01:00
William S Fulton 86498e46c6 Remove -xmllang option used with -xml
which had no effect on the output.
2024-10-15 08:59:51 +01:00
Olly Betts 7a8c9fdfa8 Straighten out handling of char and string constants
Fixes #904
Fixes #1907
Fixes #2579
Fixes #2990
2024-08-17 16:12:45 +12:00
William S Fulton 2c70a912a6 Add $isvoid special variable
The $isvoid special variable expands to 1 if the
wrapped function has a void return, otherwise expands to 0.

In the implementation, use a consistent variable name, returntype,
for a node's "type" attribute.

Issue #2907
2024-06-15 23:13:12 +01:00
William S Fulton c0b36721a3 Replace Language::is_assignable with Language::is_immutable
Avoids confusion with newly created Allocate::is_assignable.
Language::is_immutable is just a wrapper around the
"feature:immutable" flag since previous commit.

is_mutable rename wip
2023-09-07 07:01:37 +01:00
Clément DAVID e351d7faee scilab: add a gateway xml v6 with full function names 2023-04-20 07:34:19 +12:00
William S Fulton 46f7501d94 Cleanup SWIG_VERSION definition
Add Swig_obligatory_macros which must be called by each
target language to define SWIG_VERSION correctly
in the generated code, as well as the language specific
macro SWIGXXX where XXX is the target language name.

Drop the #ifdef SWIGXXX that was previously generated -
I can't see the point of this and if users are defining
this macro somehow, then users will need to change this

Closes #1050
2022-10-13 19:47:43 +01:00
Olly Betts 80d05a1a6c Eliminate 2 redundant copies of swig banner
We had a banner for C, a banner for target languages (parameterised
to allow the comment sequence to be specified) and a special banner
for XML files in scilab.cxx.

The XML variant was only needed because the standard banner contains
`--` for a hyphen, so we now use ` - ` for that instead.

The C banner now calls Swig_banner_target_lang() with a suitable
comment sequence to print the actual banner text.
2022-10-06 14:33:15 +13:00
Olly Betts 631b41ae7b Use https for swig.org links 2022-10-06 13:16:39 +13:00
William S Fulton 6939d91e4c Header file tidyup
Fix Visual C++ warning in scilab.cxx:
  warning C4996: 'strtok': This function or variable may be unsafe.
2022-05-07 11:56:06 +01:00
YungLee 31f7b437f4
[scilab] Fix to work on Windows
* 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
2022-03-15 15:06:17 +13:00
Olly Betts 55377bdc08 Add DOH Exit() and SetExitHandler()
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).
2022-03-06 12:33:54 +13:00
Olly Betts d22b7dfaea scilab.cxx: Fix source code misindentation 2022-02-24 10:45:24 +13:00
Clément DAVID f93f8ad1d5 [Scilab] remove targetversion argument
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
2022-02-21 10:01:59 +01:00
Clement David aee380ce82 [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
2022-02-02 09:43:06 +13:00
Olly Betts 9ddc9dceb7 Remove support for $source and $target
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
2021-04-30 10:20:14 +12:00
luz.paz 87695dacb1 Misc. documentation and source comment typo fixes
Found via `codespell -q 3 -L uint,od,objext,ba,cmo,bae,ans,struc,fo,clos,goin,upto,thru`
Revert changes in previous commit
2019-05-28 11:41:22 +12:00
Clément DAVID 9278593dc4 fix Scilab 6.0.0 linking issue 2017-05-30 14:42:44 +02:00
Simon Marchetto c06c9b3853 [Scilab] New parameter targetversion to specify the Scilab target version (5, 6, ..) for code generation
With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)

Signed-off-by: Simon Marchetto <simon.marchetto@scilab-enterprises.com>
2017-04-12 13:54:42 +02:00
William S Fulton 08688d7d9d Add support for "ret" typemap where missing and improve documentation on it. 2016-09-29 08:07:26 +01:00
Simon Marchetto d0a45be1eb scilab: fix issue #746 2016-07-29 16:56:30 +02:00
Simon Marchetto 95a5def328 scilab: fix issue #755 2016-07-29 11:52:26 +02:00
William S Fulton 7ec7cc63da memory leak improvements - delete at end of scope 2016-06-26 00:06:01 +01:00
Amarnath Valluri 9b371b48d1 scilab.cxx: Fix memory leaks
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
2016-06-16 15:59:21 +03:00
simon 822733bf52 scilab: fix builder for scilab 6.0 (empty matrix error) 2016-03-02 05:14:44 -05:00
Petre Eftime 0a07cd4c30 Prevent redefinition warnings when compiling with SWIG<module> defined
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
2015-12-22 14:33:21 +02:00
Simon Marchetto b05f0057ca improve support of varargs 2015-06-23 16:24:35 +02:00
Olly Betts 38a75a22c9 "suppport" -> "support" 2015-03-27 12:54:47 +13:00
William S Fulton 1fae569960 Add missing SWIGSCILAB in wrappers and fix unions test for non-scilab languages 2015-01-26 21:03:45 +00:00
Simon Marchetto 0544765abd remove -nobuilder option 2015-01-26 12:29:40 +01:00
Simon Marchetto 4c66489fd7 remove useless direct_gateway function in wrapper 2015-01-26 12:11:13 +01:00
William S Fulton 6f48e57090 Scilab command line options put in alphabetical order and some html tweaks 2015-01-22 20:03:16 +00:00
William S Fulton 96c19872bd Scilab cosmetics 2015-01-19 07:52:47 +00:00
Simon Marchetto b11f4d8e62 reduce slightly the gateway source 2015-01-14 15:43:46 +01:00
Simon Marchetto 18832e938c fix buildermode error with Scilab V6 2015-01-12 16:20:03 +01:00
Simon Marchetto 66f150b853 fix Scilab V6 support after merge of gateway & wrapper sources 2015-01-12 16:19:35 +01:00
Simon Marchetto 9c5003b022 do no generate builder by default 2015-01-08 14:06:04 +01:00
Simon Marchetto 78705a5175 gateway source is moved into wrapper source 2015-01-07 18:04:29 +01:00
William S Fulton 698248d2bf beautify scilab.cxx 2014-10-31 23:27:36 +00:00
William S Fulton c150fc033d Scilab minor coding improvements 2014-10-31 22:00:48 +00:00
Simon Marchetto 52d2291b66 Merge branch 'patch-5' of https://github.com/ibell/swig into ibell-patch-5
Conflicts:
	Source/Modules/scilab.cxx
2014-10-27 12:15:36 +01:00
Simon Marchetto 1875f841e5 scilab: simplify builder script file 2014-10-22 12:19:01 +02:00
Simon Marchetto fd1e387a0e scilab: rename build command line options 2014-10-21 17:00:51 +02:00
Simon Marchetto 6abf66324a scilab: add the SWIG banner to the generated gateway XML 2014-10-21 14:55:46 +02:00
Simon Marchetto 30faff1fce scilab: remove outputlibrary option + renaming module to gateway 2014-10-21 14:39:18 +02:00
Simon Marchetto d3afd65698 scilab: fix compilation error in scilab 5.3.3 2014-10-20 17:03:17 +02:00
Simon Marchetto 6c84d9bd3c scilab: fix gateway entry point name 2014-10-20 14:53:29 +02:00
Simon Marchetto f069cba2b4 scilab: swig generates loader script 2014-10-20 14:49:25 +02:00
Simon Marchetto c440eae1f9 scilab: fix generated gateway source (missing include, entry point name) 2014-10-20 10:16:19 +02:00
Simon Marchetto af88d49113 scilab: fix segmentation fault 2014-10-17 19:47:00 +02:00