PHP 7.1 no longer supports calling methods with fewer parameters
than declared, so we need to generate __construct() with default
values for all but the first parameter.
Add optional moduleimport attribute to %module so that the
default module import code can be overridden. See the
"Searching for the wrapper module" documentation in Python.html.
Example:
%module(moduleimport="import _foo") foo
$module also expands to the low-level C/C++ module name, so
the following is the same as above
%module(moduleimport="import $module") foo
Issue https://github.com/swig/swig/issues/769
Previously we emitted a separate one for every wrapped function,
but typically many functions have the same number of parameters
and combinations of parameters passed by reference or not.
This change significantly reduces both the size of the generated
wrapper, and of the compiled PHP extension module (e.g. by ~6% for
the stripped extension module for Xapian's PHP7 bindings).
This is SWIG's default for every language except PHP, and now is a
good time to make this change so that once we drop PHP5 support, we'll
have the same default everywhere. It's easy to override the default
with -cppext cxx to get the PHP5 behaviour.
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
The function "OutputClassMemberTable" tags methods generated
for a class so that R wrapper code supporting syntax like:
WrappedClass$VarName <- value
The comments in the function indicate that it is looking for
method names ending in "_set", but in fact it was searching for
methods ending in just "set", This was resulting in class methods
ending in set (names like GetOffset, SetOffset etc) being placed
in the wrong accessor functions and thus not being available in
the normal way.
There is probably a more appropriate way to tag the _set functions
when they are being created, which is a future step. This
patch makes the behaviour conform to the original intention.
The function "OutputClassMemberTable" tags methods generated
for a class so that R wrapper code supporting syntax like:
WrappedClass$VarName <- value
The comments in the function indicate that it is looking for
method names ending in "_set", but in fact it was searching for
methods ending in just "set", This was resulting in class methods
ending in set (names like GetOffset, SetOffset etc) being placed
in the wrong accessor functions and thus not being available in
the normal way.
There is probably a more appropriate way to tag the _set functions
when they are being created, which is a future step. This
patch makes the behaviour conform to the original intention.
* jiulongw-master:
Fix go wrapper compilation error
Fix missing semicolon in golang wrapper
Fix extra quote escape in golang
Fix #define error when value contains char in compound expression
Add more test case for char const expression in enum
Revert "Add enum test cases with const char in compound expression"
Add runtime tests for char in compound expression patch
Add enum test cases with const char in compound expression
Fix enum error when value contains char in compound expression
* [Go] Fix argument names in inherited functions #795
This commit fixes a wrong argument name replacement in the inherited functions as well as a memory leak.
* Add testcase for #795
* Move variable_replacement testcase into common
* Move variable_replacement testcase into common
The closure names used for builtin slots are mangled with their functype so
that overloaded C++ method names can be used for multiple slots.
For example:
%feature("python:slot", "mp_subscript", functype="binaryfunc") SimpleArray::__getitem__;
%feature("python:slot", "sq_item", functype="ssizeargfunc") SimpleArray::__getitem__(Py_ssize_t n);
will generate closures:
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___ssizeargfunc_closure */
SWIGPY_BINARYFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___binaryfunc_closure */
Previously the return value of call_user_function() was ignored and we
checked an uninitialised value instead. Fixes#627. Based on patch
from Sergey Seroshtan.
Default hash is the underlying C/C++ pointer.
This matches up with testing for equivalence (Py_EQ in SwigPyObject_richcompare)
which compares the pointers.
* builtin-tweaks:
Python builtin minor tweaks
Cosmetic code formatting corrections
Further additional Python builtin slots as features for user customization
Add additional Python builtin slots as features for user customization
Correct notes on customising Python builtin comparison operators
Set tp_new statically rather than during initialisation
Customize slots tp_basicsize tp_methods tp_getset
Additional Python builtin slot overrides and slightly better formatted Python generated code
Add Python builtin tp_dealloc override test
Python getSlot() refactor
Add Python builtin closure method in comment
Update Python docs on builtin slots
Python builtin hashfunc closure fix
The following slots can now be overidden by users if they know what they
are doing:
- tp_dictoffset
- tp_init
- tp_new
- tp_as_number
- tp_as_sequence
- tp_as_mapping
- tp_as_buffer
* wkalinin-nested-ignore-fix:
renamed test module, in accordance with other tests
function body fixed
added foo() definition to satisfy some test linking fails
func() renamed to foo() for 'go'
fixed test-suite/nested_ignore.i
test for #662
fix for nested ignored types
Closes#662