Commit graph

23,171 commits

Author SHA1 Message Date
William S Fulton
4c86f45c54 Fix for Java 7 - std::set and std::unordered_set 2022-10-15 14:57:30 +01:00
William S Fulton
1c70dbdb6c Bump doc version to SWIG-4.1 2022-10-15 00:28:09 +01:00
William S Fulton
7be1217d3e Allow wkhtmltopdf to access current directory
Fix for version 0.12.6, see https://github.com/wkhtmltopdf/wkhtmltopdf/issues/4536
2022-10-15 00:28:04 +01:00
William S Fulton
0e60d6b7a4 Correct new Raise functions to be static 2022-10-14 22:51:26 +01:00
William S Fulton
fd2420cdcc Remove STRING_VALUE to keep supporting older versions of R
STRING_VALUE does not work with R_NO_REMAP
in older versions (it broke 3.0.2)
2022-10-14 22:49:07 +01:00
William S Fulton
15c433c5f9 C89 fixes 2022-10-14 22:34:18 +01:00
William S Fulton
1b5c4546ba Add v8 numeric change to changes file 2022-10-14 19:25:13 +01:00
William S Fulton
bba072d95d Merge branch 'fix-cast'
* fix-cast:
  add tests for new casting behavior
  skip tests when value is out of range
  refactor integers JS testcase to avoid repeating code
  Return uint64_t as double if is bigger than uint32_t
  Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match (#3)
2022-10-14 19:19:13 +01:00
William S Fulton
54497fce49 html fixes 2022-10-14 08:45:38 +01:00
William S Fulton
7334e9c16f
Merge pull request #2401 from hramrach/master
Define PY_SSIZE_T_CLEAN only when not defined yet
2022-10-14 07:56:09 +01:00
Olly Betts
5f96d15943 [R] Run destructors of local C++ objects on SWIG_fail
Arrange that destructors of local C++ objects in the wrapper function
get run on SWIG_fail (which calls Rf_error() which calls longjmp()).

We achieve this by putting almost everything in the function in its
own block, and end that right before Rf_error() at which point those
destructors will get called.
2022-10-14 14:44:19 +13:00
Olly Betts
fefb231bd8 [php] Update exception_memory_leak_runme.php
Test the new "return by value" case too.
2022-10-14 14:44:19 +13:00
Olly Betts
9ab9c71623 [lua] Run destructors of local C++ objects on SWIG_fail
Arrange that destructors of local C++ objects in the wrapper function
get run on SWIG_fail (which calls lua_error() which calls longjmp()).

We achieve this by putting almost everything in the function in its
own block, and end that right before lua_error() at which point those
destructors will get called.
2022-10-14 14:44:19 +13:00
Olly Betts
3dd7e93c77 Fix issues with exception_memory_leak testcase
The out typemap uses a function name which doesn't match the name of the
function we want it to apply to, so this testcase wasn't actually
triggering an exception so wasn't actually testing anything!

With that fixed, the testcase fails to compile for PHP due to use of
SWIG_exception_fail() (which not all target languages implement), and
with that fixed, the _runme.php needs a try ... catch adding to handle
the raised exception.
2022-10-14 12:12:21 +13:00
Michal Suchanek
c3f17b415d Define PY_SSIZE_T_CLEAN only when not defined yet
Users of swig 4.0.2 and python 3.10 will likely define the
PY_SSIZE_T_CLEAN macro by hand when relevant because their bindings
won't build otherwise.

Unconditionally defining PY_SSIZE_T_CLEAN in swig 4.10 will lead to
macro redefinition warning.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2022-10-13 23:26:58 +02:00
William S Fulton
752b7e82cd Add missing SWIGTYPE *const& typemaps 2022-10-13 22:22:18 +01:00
William S Fulton
f13de56e5f Revert "[xml] Move to "Experimental" target language status"
This reverts commit 22a4355f34.

Conflicts:
	CHANGES.current
	RELEASENOTES
2022-10-13 21:14:44 +01: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
e123c2afe8 Additional SWIG_VERSION testing 2022-10-13 08:09:13 +01:00
William S Fulton
c82aa3bb41 Quick fix SWIG_VERSION not being defined correctly in wrappers 2022-10-13 07:57:09 +01:00
Sergio Garcia Murillo
cdb0e498a1
Merge pull request #2 from mildsunrise/fix-cast
expand testcase to test for new casting behavior
2022-10-11 14:09:07 +02:00
William S Fulton
6b6761abac Update 4.1.0 release notes summary 2022-10-10 23:58:39 +01:00
William S Fulton
d5a0201c54 XML whitespace changes
Remove non-conventional whitespace before closing tag with '>'.
2022-10-10 23:58:39 +01:00
Olly Betts
5be76e6dcc Makefile.in: Remove unused variables dd and srpm
srpm is no longer used since the recent removal of the srcrpm
target in 623b7d97a7.

dd hasn't been used since 4ce80105c8
back in 2006!
2022-10-11 10:30:37 +13:00
Olly Betts
ac00c7ad98 Fix php example comment typo 2022-10-11 10:30:37 +13:00
Olly Betts
abf5c8a357 [python] Remove doc caveat for Python < 2.1
The minimum version we now support is Python 2.7.
2022-10-11 10:30:37 +13:00
Olly Betts
87a677b8b3 Fix doc typos 2022-10-11 10:30:33 +13:00
William S Fulton
2268d6ee96 Fix compile error when using directors
Fix when using templates with more than one template parameter
and used as an input parameter in a virtual method in a
director class (problem affecting most of the scripting languages).

Fixes #2160
2022-10-10 19:51:08 +01:00
William S Fulton
0239ba5536 OCaml director return fix
Fixes director_unwrap_result testcase when returning Element *const *&
2022-10-10 18:55:37 +01:00
Alba Mendez
55d7a51343 add tests for new casting behavior
more integers are preserved now
2022-10-10 13:28:44 +02:00
Alba Mendez
5b02dc93d6 skip tests when value is out of range 2022-10-10 13:28:44 +02:00
Alba Mendez
cf7733e4b8 refactor integers JS testcase to avoid repeating code 2022-10-10 12:49:57 +02:00
William S Fulton
2f55379687 Improve director unwrap detection for the return type
Resolve the return type to correctly determine if the type is a pointer or
reference to a director class.

SwigType_refptr_count_return() recently added as a simpler fix is no
longer needed.

The conventional approach of using the "type" rather than "decl" to
analyse the return type is used instead too.

Issue #1823
2022-10-10 08:45:26 +01:00
William S Fulton
4a397869a2 Merge branch 'director-unwrap-result'
* director-unwrap-result:
  Unwrap director classes only when returning a pointer or reference to an object
2022-10-07 18:41:14 +01:00
William S Fulton
e1fdb67f09 Document CFFI removal 2022-10-06 23:29:33 +01:00
William S Fulton
cea25abca5 Completely remove CFFI
No meaningful progress to update CFFI to experimental status
has been made since CFFI was disabled in SWIG-4.0.0 as the first
stage to removal. This commit is the final stage to remove it.

See issue #1966 for an attempt at updating CFFI to experimental
status. Anyone wishing for SWIG to support CFFI again might
want to utilise this work.
2022-10-06 23:29:33 +01:00
William S Fulton
7b0f7caaf2 Makefile re-order
All target languages are in now in alphabetical order
2022-10-06 23:29:33 +01:00
William S Fulton
b975f401a9 Re-order language detection in configure.ac
Check in alphabetical order to make looking at configure output a tad easier
2022-10-06 23:29:33 +01:00
William S Fulton
19a5f3f4a5 Remove some final testing
Given Visual C++ does not work with these tests (tested with VS2022 17.3 and earlier)
2022-10-06 21:51:18 +01:00
Olly Betts
f54c504150 Remove dead conditional code
SWIG_POINTER_EXCEPTION has had the value zero since 2006 (it's only
still present for backward compatibility).
2022-10-06 18:09:08 +13:00
Olly Betts
37c8185bd3 Replace reference to SWIG_POINTER_EXCEPTION in docs
This has only been present for backward compatibility since 2006
and now has the value 0 so doesn't do anything, so don't use it
as an example of a flag in the docs.
2022-10-06 18:06:36 +13:00
Olly Betts
047928d670 Fix comment typo 2022-10-06 18:06:20 +13: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
5fb5c5f74d Update mingw links
The mingw.org domain is no longer associated with the project, and
they've also moved from sourceforge to osdn.
2022-10-06 13:46:12 +13:00
Olly Betts
a71234b25d Use https for links in docs where supported 2022-10-06 13:41:21 +13:00
Olly Betts
2e678369e6 Make licence boilterplate for go.cxx match other files
The existing text refers the reader to LICENSE for the actual
license like the standard boilerplate does.
2022-10-06 13:17:06 +13:00
Olly Betts
631b41ae7b Use https for swig.org links 2022-10-06 13:16:39 +13:00
Olly Betts
6f3f4fbdf1 [Python] Remove deprecated and apparently useless defarg.swg
The only documentation is in the file itself and describes a Python
wrapper around the C function defined here, but digging though the git
history this Python wrapper doesn't seem to have ever actually been
generated by SWIG.

This file was also marked as deprecated in 2005.

Fixes #2390
Fixes #2391
2022-10-06 12:57:48 +13:00
William S Fulton
bc87fe151e Fix python/c++ coding confusion!
Visual c++ does not support 'and' yet.
2022-10-06 00:45:53 +01:00
William S Fulton
07f265a3bf Changes file typo fix 2022-10-06 00:38:03 +01:00