| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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]
```
|
|
|
|
|
| |
This supports the use of Py_LIMITED_API and also uses
PyUnicode_AsUTF8AndSize if Py_LIMITED_API is set to 3.10 or newer.
|
|
|
|
|
|
|
| |
Cast a parameter type explicitly rather than implicitly by casting
the function pointer type, as the latter is undefined behaviour.
Caught by ubsan.
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
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
|
| | |
|
| |
| |
| |
| | |
To fix overloading when using these 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
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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).
|
|\ \
| | |
| | | |
Use PyObject instead of PySliceObject throughout with Python 3.2+
|
| | |
| | |
| | |
| | | |
This supports use of the Py_LIMITED_API.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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
|
| |/ / |
|
|/ /
| |
| |
| |
| | |
Closes #2345
Also supported with Py_LIMITED_API
|
| |
| |
| |
| | |
(builtin mode) for Python-3.11 - _ht_tpname, _spec_cache.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix mishandling of a Python class inheriting from multiple SWIG-wrapped
director classes.
Fixes #422
Fixes https://sourceforge.net/p/swig/bugs/1379/
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* unique_ptr-inputs:
std::unique_ptr std::auto_ptr tidyup
Add support for std::auto_ptr inputs
Cosmetic formatting and doc updates in std_unique_ptr.i files
Add Perl support for std::unique_ptr inputs
Add Ruby support for std::unique_ptr inputs
Add Python support for std::unique_ptr inputs
Add C# support std::unique_ptr inputs
Java unique_ptr test ownership enhancement to test
Java unique_ptr enhance test for double release
SWIGTYPE && input typemaps now assume object has been moved
Add Java support for std::unique<T> for input parameters.
Closes #692
Conflicts:
CHANGES.current
|
| | |
| | |
| | |
| | | |
Ported from std::unique, behaviour is identical with regard to memory ownership/handling
|
| | | |
|
| | |
| | |
| | |
| | | |
Equivalent to Java/C# implementation.
|
| | | |
|
|/ /
| |
| |
| | |
Closes #2314
|
| |
| |
| |
| |
| | |
More removal of casts in the out typemaps when copying objects to enable
C++ compilers to possibly make use of move semantics.
|
| |
| |
| |
| |
| |
| |
| | |
The directorin typemaps in the director methods now use std::move on the
input parameter when copying the object from the stack to the heap prior
to the callback into the target language, thereby taking advantage of
move semantics if available.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Simple copy of current auto_ptr support (just suppport for
functions returning std::unique_ptr).
Closes #1722
|
| |
| |
| |
| |
| |
| |
| | |
Such as:
/usr/include/python2.7/unicodeobject.h:534:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
Closes #2227
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* python:
Define PY_SSIZE_T_CLEAN macro
Python: define PY_SSIZE_T_CLEAN
Conflicts:
CHANGES.current
|
| | |
| | |
| | |
| | |
| | |
| | | |
before #include "Python.h" as recommended in Python 3.7 and later.
Issue #2277
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It is recommended to always define PY_SSIZE_T_CLEAN before including
Python.h. Cf. https://docs.python.org/3/c-api/intro.html
This avoids errors like:
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* more_argcargv:
Document argc argv library
argcargv.i cosmetic updates
Typemaps for (int ARGC, char **ARGV) fixup
Fix argcargv.i in Perl5, Tcl, PHP Add missing type map for type check. Add testing of argcargv.i for Perl5, Tcl, PHP and Ruby.
Add Lua test for argcargv.i
Add argcargv.i to more languages: Perl 5, Tcl, PHP
Add argcargv.i to Lua
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes:
warning C4311: 'type cast': pointer truncation from 'void *' to 'long'
warning C4302: 'type cast': truncation from 'void *' to 'long'
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| | |
The tp_print slot is no longer supported and replaced with tp_vectorcall_offset.
The (printfunc) cast that we used caused problems on PyPy.
Fixes #2262
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* feature/python-builtin-separate-runtime-data:
Rework swig_and_compile_multi_cpp makefile helper
Different capsule names for builtin changes entry
Use different capsule names with and without -builtin
Conflicts:
CHANGES.current
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Types generated with and without -builtin are not compatible. Mixing
them in a common type list leads to crashes. Avoid this by using
different capsule names: "type_pointer_capsule" without -builtin and
"type_pointer_capsule_builtin" with.
See #1684
|
|/ /
| |
| |
| |
| |
| |
| | |
pyabc.i for abstract base classes now supports versions of Python
prior to 3.3 by using the collection module for these older versions.
Python-3.3 and later continue to use the collections.abc module.
The -py3 option no longer has any effect on the %pythonabc feature.
|
| |
| |
| |
| | |
Issue #2208
|
| |
| |
| |
| |
| |
| |
| | |
This should be a SWIG-time conditional, but was inside %{ %} so was
instead a compile-time conditional.
Fix for bug in the changes in #2191
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
SWIG python objects were being freed after the corresponding SWIG
module information was destroyed in Python 3, causing leaks when as
a result the object destructor could not be invoked. To prevent this
misordering, SWIG python objects now obtain a reference to the
Python capsule wrapping the module information, so that the module
information is correctly destroyed after all SWIG python objects
have been freed (and corresponding destructors invoked).
Fixes #2154
Fixes #2208
|
| | |
|
|/
|
|
|
|
| |
This is necessary for regex-like renames (where you can't use the #define trick
as is done in many of the %keywordwarn directives). It's now unnecessary to print
the "renaming to '`x`'" code explicitly by the kw.swg files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SWIG_PyInstanceMethod_New method is no longer added to wrapped
classes except when it's actually needed, which is when
(!builtin && fastproxy) is true (which it isn't by default).
The SWIG_PyStaticMethod_New method is no longer is now similarly
gated - previously only (fastproxy) was checked.
Finally the C/C++ functions that implement these were always compiled
into the module, but now they're only included if
(!builtin && fastproxy) is true.
Issue noted by vadz in #2190.
|
|
|
|
| |
Fixes #2090
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fallback version of PyString_AS_STRING() for Python 3 makes use of
PyUnicode_AS_STRING, but I can find no evidence that ever existed in
Python - all references I've found are to SWIG or SWIG-generated code.
The only uses of PyString_AS_STRING() in SWIG generated code are for
Python 2 #if-branches, so this fallback is never used by SWIG.
Because it doesn't work it can't be usefully used in user interface
files either, so let's remove it to avoid potential user confusion
(such as #987).
|