Commit graph

74 commits

Author SHA1 Message Date
Olly Betts
631b41ae7b Use https for swig.org links 2022-10-06 13:16:39 +13:00
Olly Betts
6b4d5fe3f0 Remove remaining code to support macos9
This OS has been unsupported for over 20 years.  We stopped providing
macswig builds more than 20 years ago too:

https://sourceforge.net/projects/swig/files/macswig/

The required SIOUX library doesn't seem to be available anywhere
now either.

Closes #2323
2022-07-19 11:22:37 +12:00
Olly Betts
22a4355f34 [xml] Move to "Experimental" target language status
The XML target language support is not in good shape and is likely to be
removed unless somebody steps up to bring it up to the expected standard
(it fails to even meet the criteria for "Experimental" currently).

Closes #2213
2022-07-08 16:34:19 +12: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
e38847f7e1 Fail cleanly on allocation failures
Previously code in the SWIG tool didn't handle allocation failures
well.  Most places didn't check for NULL return from
malloc()/realloc()/calloc() at all, typically resulting in undefined
behaviour, and some places used assert() to check for a NULL return
(which is a misuse of assert() and such checks disappear if built with
NDEBUG defined leaving us back with undefined behaviour).

All C allocations are now done via wrapper functions (Malloc(),
Realloc() and Calloc()) which emit and error and exit with non-zero
status on failure, so a non-NULL return can be relied upon.

Fixes #1901.
2022-03-04 11:47:49 +13:00
Vadim Zeitlin
45fdcc2fec Fix reading options files on platforms with unsigned char
This fixes EOF detection on platforms where char is unsigned, as
comparing it with EOF could never return true there.

Thanks gcc for the warning "comparison is always true due to limited
range of data type [-Wtype-limits]".
2020-02-16 17:03:14 +01:00
William S Fulton
ad7f9cd8d7 Mark and setup OCaml as an experimental target language.
Issue #1437
2019-02-11 18:30:35 +00:00
Olly Betts
ce5a249878 Drop -php4 option completely
SWIG's support for PHP4 was removed over a decade ago, and PHP4 itself
went out of security support more than a decade ago too - nobody is
realistically going to be trying to generate PHP4 bindings in 2019.
2019-02-11 10:49:20 +13:00
William S Fulton
b4257fb1f2 Mark MzScheme as an experimental language 2019-02-09 17:58:06 +00:00
William S Fulton
df86ec5af6 Consistent use of target language version of options
If a version number is supported by the target language prefer to show it in the -help.
For example, -perl5 instead of -perl.
2019-02-05 19:18:46 +00:00
William S Fulton
29d30bd319 Consistent implementation for disabled languages
The deprecated php4 and php5 use the new Disabled language handling
recently implemented for a consistent implementation
2019-02-05 19:04:59 +00:00
William S Fulton
264b39fd00 Disable CFFI Common Lisp target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:42:23 +00:00
William S Fulton
6d7e3df54e Disable Allegrcol target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:42:16 +00:00
William S Fulton
09e0577d95 Disable Chicken target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:42:12 +00:00
William S Fulton
cb4bd26422 Disable Common Lisp / CLISP target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:42:07 +00:00
William S Fulton
df51dc8e8f Disable Common Lisp / S-Exp target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:42:00 +00:00
William S Fulton
f63d0db21b Disable Common Lisp / UFFI target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:41:54 +00:00
William S Fulton
8aa4086136 Disable Pike target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:41:46 +00:00
William S Fulton
ee3aeb8177 Disable Modula3 target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:41:34 +00:00
William S Fulton
9defd8e033 Add support for differentiating target language statuses
Three status: Disabled, Experimental and Supported.

Any target language classified as 'Experimental' will issue new warning
524 SWIGWARN_LANG_EXPERIMENTAL.
Any target language classified as 'Disabled' will error out.

Languages will be classified in forthcoming commits.

Issue #1437
2019-02-04 18:46:16 +00:00
Olly Betts
ec72026285 Stop defaulting to Tcl
SWIG now requires a target language to be specified instead of
defaulting to wrapping for Tcl.  Specifying swig --help without
a target language now just shows the generic help.  The -nolang
option has been removed.
2019-02-01 12:57:00 +13:00
Olly Betts
d6d5db122b Remove support for PHP5
PHP5 is no longer actively supported by the PHP developers and security
support for it ends completely at the end of 2018, so it doesn't make
sense to include support for it in the upcoming SWIG 4.0.0 release.

See #701.
2018-06-07 18:09:03 +12:00
Joshua Watt
e9b4d3378b Add option file support
Arguments may be passed using an option file prefixed with the '@'
character. Processing of option files is the same as for the same
feature in gcc.
2018-01-12 15:01:45 -06:00
Joshua Watt
7eff4e7c1d Terminate options when passed via env var
The C standard requires that argv be terminated with a NULL pointer
(that is, argv[argc] == NULL). There are several places in the swig
codebase that require this to check for missing arguments. However,
SWIG_merge_envopt() was not keeping the NULL terminator, resulting in
argument parsing failures (typically program aborts) when arguments were
passed via the SWIG_FEATURES environment variable.
2017-12-04 09:28:17 -06:00
Olly Betts
1169874f59 [PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use
-php7 to specify you want PHP7 compatible wrappers.
Fixes https://github.com/swig/swig/issues/571
2016-11-30 13:05:59 +13:00
Simon Marchetto
adc4b788df Merge remote-tracking branch 'origin/master' into gsoc2012-scilab
Conflicts:
	.gitignore
	.travis.yml
	configure.ac
2015-01-26 10:50:20 +01:00
Olly Betts
fc60a97ebe Drop deprecated warnings for ancient options
Support for -stat was removed in SWIG 1.3 Alpha 1 nearly 15 years ago,
and the documentation options were removed prior to that, so issuing a
warning that they are deprecated and ignoring them serves no useful
purpose now.
2015-01-08 10:55:58 +13:00
Simon Marchetto
07b06a4089 Merge branch 'master' into gsoc2012-scilab
Conflicts:
	.gitignore
	.travis.yml
	COPYRIGHT
	Examples/Makefile.in
	Examples/test-suite/constructor_copy.i
	Makefile.in
	configure.ac
2014-06-06 16:33:16 +02:00
William S Fulton
244ad06c25 Alphabetical order for Javascript in -help output 2014-04-10 08:11:33 +01:00
Oliver Buchtala
6dcbbf07db Conflicts:
.gitignore
	.project
	.travis.yml
	Examples/Makefile.in
	Examples/test-suite/director_nspace.i
2013-09-27 02:29:02 +02:00
William S Fulton
d4df5fb07b Code style fixes.
Output after running 'make beautify-file' on scilab file
2013-08-30 19:51:58 +01:00
Sylvestre Ledru
21e17eaa73 Merge remote-tracking branch 'origin/master' into gsoc2012-scilab
Conflicts:
	Examples/Makefile.in
2013-08-06 10:06:31 +02:00
William S Fulton
7841a0d097 Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
Oliver Buchtala
d71a5f483a Add module for Javascript target.
This module comes with a design that allows different code emitter implementations.
For the the phase of development the module is split into multiple files
which will be merged together when development converges.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13737 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:44:54 +00:00
Sylvestre Ledru
954256979c Merged from trunk
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12656 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-06 10:15:45 +00:00
David Nadlinger
03aefbc6e9 Added support for the D programming languge.
It is still a bit rough around some edges, particularly with regard to multi-threading and operator overloading, and there are some documentation bits missing, but it should be fine for basic use.

The test-suite should build and run fine with the current versions of DMD, LDC and Tango (at least) on Linux x86_64 and Mac OS X 10.6.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12299 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-18 00:24:02 +00:00
Sylvestre Ledru
1842244c93 Merge from trunk
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12270 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-10-14 14:15:42 +00:00
Ian Lance Taylor
5af2978f77 Add support for the Go programming language.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12108 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-10 01:13:31 +00:00
Baozeng Ding
07cb6351f1 merge from trunk
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12002 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-30 03:03:24 +00:00
William S Fulton
f2b542d8f4 merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11906 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-03-06 01:19:37 +00:00
William S Fulton
cb64f65bae SWIG license change - Source moves to GPLv3
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11876 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:53:33 +00:00
William S Fulton
751b8d3b45 Fix #2894405 - assertion when using -xmlout.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11841 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-05 22:22:35 +00:00
Baozeng Ding
4aa72f9b01 Implement functionwrapper
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11242 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-05-30 07:10:19 +00:00
William S Fulton
06b2eca75e remove last vestiges of php4 and encourage use of -php rather than -php5
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10969 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-06 23:15:20 +00:00
Olly Betts
9ff8981708 [PHP4] Support for PHP4 has been removed. The PHP developers are
no longer making new PHP4 releases, and won't even be patching
critical security issues after 2008-08-08.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10626 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-07-02 05:55:18 +00:00
Xavier Delacour
393391965c Initial commit of Octave module.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10290 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-03-01 23:35:44 +00:00
William S Fulton
fe042d2ebc Replace cvs $Header$ with svn $Id$
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10003 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-10-17 21:42:11 +00:00
William S Fulton
b0c537e4c6 fix alphabetical order
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9918 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-08-28 20:17:08 +00:00
William S Fulton
aa04c4c057 beautify/format source code with gnu indent
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-11-01 23:54:54 +00:00
Joseph Wang
ef80a4f59a Committing R-SWIG
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9175 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-06-29 03:01:18 +00:00