Look up unknown base classes using SWIG_MangledTypeQueryModule().
Revert to using SWIG_TypeCheck() instead of SWIG_TypeCheckStruct()
as the latter doesn't seem to work for this case (at least for PHP
right now).
Add mod_runme.php as a regression test for this.
Adjust the PHP test harness not to set up reflection for the module
unless it's actually needed for a testcase. Currently the approach
to find the module name doesn't work for multi-module testcases.
See #2126
* 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)
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>
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
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
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.
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#2390Fixes#2391
* python_subinterpreter_issues:
added comment in CHANGES.current
always get the type_pointer from capsule instead of using a static variable as the value may change after re-initilization/due to subinterpreters
added interpreter_counter to deinitialize only once in case of subinterpreters
Conflicts:
CHANGES.current
Lib/python/pyrun.swg
Ensure that SWIG_VERSION is defined both at SWIG-time and in the
generated C/C++ wrapper code (it was only defined in the wrapper
for some target languages previously).
SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers
to match behaviour for all other target languages.
Stop defining SWIGVERSION in the wrapper. This only happened as a
side-effect of how SWIG_VERSION was defined but was never documented and
is redundant.
The new testcase also checks that SWIG is defined at SWIG-time but not
in the generated wrapper, and that exactly one of a list of
target-language specific macros is defined.
Fixes#1050
Output C/C++ type strings (| separated) in swig_type_info tables in
fixed order. The types are output in alphabetically sorted order,
with an exception. The final type is a fully resolved type, but
does not necessarily include default template parameters.
This type is the one used by SWIG_TypePrettyName which is commonly
used to display a type when the wrong type is passed in as a
parameter.
Previously the order was not very deterministic due to the use of
internal hash tables which do not have an ordering guarantee.
These testcases were segfaulting:
prefix
director_using_member_scopes
virtual_poly
The fix here is admittedly a hack - we perform the initialisation
of EG(class_table) from CG(class_table) which PHP will do, but
hasn't yet.
PHP doesn't seem to clearly document which API calls are actually
valid in minit or other initialisation contexts, but the code we're
generating works with all PHP 7.x and PHP 8.x versions aside from PHP
8.0 so it seems this is a bug in PHP 8.0 rather than that we're doing
something invalid, and we need to work with existing PHP 8.0 releases
so this hack seems a necessary evil. It will at least have a limited
life as PHP 8.0 is only in active support until 2022-11-26, with
security support ending a year later.
Fixes#2383.
Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that
thrown string exception messages can be seen.
Test all language for std::string throws typemaps
and exception specifications for native types.
Now the raised exception contains the string value as the exception
message instead of just the C/C++ type of the exception.
R exceptions were completely swallowed beforehand
For implementing full move semantics when passing parameters by value.
Based on SWIGTYPE && and std::unique_ptr typemaps which implement move
semantics.
Added for all languages, but untested for: Go, Ocaml, R, Scilab (and
unlikely to be fully functional for same reasons as for std::unique_ptr
support).
Issue #999
Recent change to SwigValueWrapper required the <utility> header.
Included headers should be after the include of the language
specific header files (which go into the earlier runtime section).
Testcase required -Winit-list-lifetime warning suppression change
for Perl which somehow lost the warning suppression when put
into the %begin section.
Only use the corecrt.h workaround for #2090 when using
SWIG_PYTHON_INTERPRETER_NO_DEBUG as the problem seems to only
occur when undefining _DEBUG.
Also extend workaround for Visual Studio 2019 version 16.10 and 16.11
as per #2174 (_MSC_VER=1929).
* rvalue-move:
rvalue reference outputs
Remove broken %implicitconv for const SWIGTYPE &&
Remove unnecessary const SWIGTYPE & typemap
Temporarily remove rvalue reference python runtime test
std::auto_ptr emulation fix in test case
Ocaml typemap typo fix
Fix Racket tests using schemerunme directory
Docs on rvalue parameter changes
Test/fixes to handle NULL pointer for unique_ptr/auto_ptr
Octave - SWIG now marshalls a C/C++ NULL pointer into the null matrix, []
Racket - NULL pointer handling
SWIGTYPE && input typemaps now assume object has been moved - Go and OCaml
SWIGTYPE && input typemaps now assume object has been moved
SWIGTYPE && input typemaps now assume object has been moved - Java
Cosmetic stray semi-colon removal after %typemap using quotes
Cosmetic stray semi-colon removal after %typemap
Typemaps should be for SWIGTYPE &&, not just const SWIGTYPE &&.
Needs updating for new approach where the proxy object is moved
for a parameter containing an rvalue reference.
SWIG has always marshalled the null matrix into a NULL pointer; this remains
and now we have consistency in representing a NULL pointer.
This is a pre-requisite for a pending commit to fully support std::unique_ptr.
SWIG now converts a C/C++ NULL pointer into a null value by calling
scheme_make_null(), so that scheme's null? is true for a NULL C/C++
pointer value.
Consistency with Guile and needed for a pending commit for handling
NULL and std::unique_ptr.
Not fully implemented and Untested.
Go's implementation needs fixing to fully support typemaps
before this can be done.
OCaml implementation does not have support for releasing ownership
which is required to add error checking preventing double deletes.