| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
[Python] Eliminate sprintf in generated code
|
| |
| |
| |
| |
| |
| |
| | |
Newer clang versions emit warnings in generated code:
```
warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
```
|
|/ |
|
|
|
|
|
|
|
|
|
| |
Without this, perlhead.swg does `#pragma GCC diagnostic pop`
if `__GNUC__ >= 10` - without any prior `#pragma GCC diagnostic push`.
There's also a mismatch between the conditions that trigger
`#pragma GCC diagnostic ignored` (where the `push` should be)
and the attempt to `#pragma GCC diagnostic pop`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Further switch to use rtypecheck typemaps instead of hard coded logic.
The full switch to typemaps is deferred until swig-4.2 as it can't be fully
backwards compatible. For now a warning is provided to help the
transition. It provides the full typemap that should be placed into
a user's interface file, for example:
%typemap("rtype") int32_t * "integer"
void testmethod(int32_t * i);
void testmethod();
If there is no rtypecheck typemap for int32_t *, the warning shown is:
example.i:7: Warning 750: Optional rtypecheck code is deprecated. Add the
following typemap to fix as the next version of SWIG will not work without it:
%typemap("rtypecheck") int32_t * %{ (is.integer($arg) || is.numeric($arg)) %}
The warning is shown for any code that previously used "numeric", "integer" or
"character" for the rtype typemap. Copying the rtypecheck typemap as
shown into the user interface file will provide the appropriate fix and
the warning will disappear. This is important to do as swig-4.2 will
not be able to provide this helpful warning.
|
|
|
|
|
|
|
|
| |
- Fix for special variable $argtype expansion in rtypecheck typemap.
- Remove unnecessary () brackets when using rtypecheck typemap for
single parameter functions.
- Add rtypecheck typemaps for shared_ptr so that NULL can be used
in overloaded functions taking shared_ptr.
|
|
|
|
|
|
|
|
|
| |
Fix leak when a cast up a class inheritance chain is
required.
Adds implementation of SWIG_ConvertPtrAndOwn for R.
Closes #2386
|
|
|
|
|
| |
This supports the use of Py_LIMITED_API and also uses
PyUnicode_AsUTF8AndSize if Py_LIMITED_API is set to 3.10 or newer.
|
|
|
|
|
|
|
|
| |
Fix problems in shared_ptr wrappers where the class names were
not consistent when using the shared_ptr template or the actual
underlying type. Move $R_class substitution to typemaps.
Issue #2386
|
|
|
|
|
|
|
| |
Cast a parameter type explicitly rather than implicitly by casting
the function pointer type, as the latter is undefined behaviour.
Caught by ubsan.
|
|
|
|
| |
See #2126
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Closes #2385
|
| |
|
| |
|
|
|
|
|
| |
STRING_VALUE does not work with R_NO_REMAP
in older versions (it broke 3.0.2)
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
* 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)
|
| |\ |
|
| | | |
|
| | |
| | |
| | | |
Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | | |
SWIG_POINTER_EXCEPTION has had the value zero since 2006 (it's only
still present for backward compatibility).
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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
|
| | | |
| | | |
| | | |
| | | | |
as the value may change after re-initilization/due to subinterpreters
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Avoid UTF-32 to UTF-8 conversion then get string from UTF-8
Missing change that should have gone into eaf468e9e8d3ef17f397ef6bc5e73807a2bf3594
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We need to include php.h before stdio.h (and probably before most
other libc headers).
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Avoid UTF-32 to UTF-8 conversion then get string from UTF-8
Issue #2369
|
| | | |
| | | |
| | | |
| | | | |
For efficiency and to fix some warnings
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | | |
To fix overloading when using these types.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
To prevent seg faults when passing #nil to these parameter types.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|