In PHP 8.2 zend_operators.h contains inline code which triggers this
warning and our testsuite uses with option and -Werror.
I don't see a good way to only do this within our testsuite, but
disabling it globally like this shouldn't be problematic.
Includes the majority of patch #1484.
Excludes changes in typepass.cxx for specializations which have no effect
on the duplicate_class_name_in_ns testcase, nor the rest of the test-suite.
Unfortunately the changes of 26bf86322 (Use SWIG-specific for
non-overloaded synthesized functions too, 2021-11-09) did break some
existing code bases using SWIG as they hardcoded the old wrapper
function names.
So turn this off by default and add a global variable allowing to enable
this, which can be done for a specific language only. This is ugly but,
unfortunately, there is no way to use the Language object from the C
function Swig_MethodToFunction(), so the only alternative would be to
add another parameter to it, but it already has 6 of them, so it
wouldn't really be that much better.
See #2366, #2368, #2370.
Particularly when using virtual inheritance as the pointers weren't
correctly upcast from derived class to base class when stored in the
base's proxy class.
Fixes commented out test code in cpp11_std_unique_ptr_runme
and li_std_auto_ptr_runme D tests.
I don't think any valid C program can contain `<=>` in a tokenisable
context, but it's more helpful to fail with a syntax error at SWIG
parse time and not potentially generate C code trying to use `<=>` in
an expression which then fails at compile time.
This reverts commit 0ff9a0959a.
The modified fix breaks Java and C#, where C constant expressions
get used in the generated target language code in some cases.
Revert this fix for now.
Remove some erroneously added brackets_increment() calls.
Reject <=> in preprocessor expressions with a clear error message (it
seems it isn't supported here - clang and gcc don't at least).
The type returned by `<=>` is not `bool`. We pretend it's
`int` for now, which should work for how it's likely to be used
in constant expressions.
Fixes#1622
This OS has been unsupported for over 20 years. We stopped providing
macswig builds more than 20 years ago too:
https://sourceforge.net/projects/swig/files/macswig/
The required SIOUX library doesn't seem to be available anywhere
now either.
Closes#2323
Avoid using reserved identifiers such as `_DOHINT_H` (fixes#1989),
fix cases where the name doesn't match the filename, and make the naming
more consistent and less likely to collide with include guards in other
headers.
Under %feature("php:type", "compat") we don't generate return type
declaration for virtual methods if directors are enabled for that class.
However if a base class of the class has a method of the same name which
isn't directed this was still getting a return type declaration which
caused PHP to give an error when it tried to load the module.
Now we detect this situation and suppress the base class method's
return type declaration too.
Re-enable testcase director_redefined which now works again (it was
failing under PHP8 due to this issue).
See #2151
Performance optimisation for parameters passed by value that are C++11 movable.
Test copy constructor and assignment operator calls for movable types
Conflicts:
CHANGES.current
Changing the hash function breaks some testcases.
It seems there's a latent bug here (I suspect something somewhere in
SWIG depends on the hash iteration order), but I didn't see where and
we can't really have CI continuing to fail.
See #2303.
This reverts commit 5a96a39aa4.
Encapsulate the code to generate arginfo in the PHPTypes class.
By itself this should result in no functional changes, but it's
a step towards being able to delay arginfo generation which I
think is necessary to address the incompatible overridden
method problem discussed in #2151.
The C++ wrappers create a temporary variable for a parameter to be passed to a
function. This is initially default constructed and then copy assigned from the
instance being passed in from the target language. This is unchanged, however,
when the temporary variable is passed to wrapped function, it is now done using
std::move. If the type is move constructible, the move constructor will be used
instead of the copy constructor.
Note that the implementation calls std::move for all user-defined types
(non-primitive types passed by value), this excludes anything passed by pointer,
reference and arrays. It does also include any type that has not been
defined/parsed by SWIG, that is, unknown types. std::move is called via the
SWIG_STD_MOVE macro which only calls std::move for C++11 and later code.
The XML target language support is not in good shape and is likely to be
removed unless somebody steps up to bring it up to the expected standard
(it fails to even meet the criteria for "Experimental" currently).
Closes#2213
The one we're currently using only considers the last five characters
plus the least significant bit of the last-but-sixth character, which
unsurprisingly generates a lot of many-way collisions.
This change seems to give about a 4% reduction in wallclock time for
processing li_std_list_wrap.i from the testsuite for Python. The
hash collision rate for this example drops from 39% to 0!
Closes#2303
If the same method name is implemented in a parent class then the
subclass can't have more required parameters than that or else we
get a compatibility error when the module is loaded.
The testsuite wasn't catching this problem because it was no longer
trying to load the modules for testcases without _runme.php, because
the mechanism to do that relied on there being a generated .php
wrapper, which we no longer have by default. Fix that to provide a
regression test for this fix.
See #2151
Otherwise can end up with a second PHP exception if the directorout
typemap doesn't accept PHP Null. `SWIG_fail` in this case results
in us returning to PHP which then propagates the pending exception.
This commit fixes a failure in smoketest.php in Xapian's PHP bindings,
but I've not managed to come up with a reproducer which works for
SWIG's testsuite.
I missed that this change breaks cpp_static, which seems to be to do
with handling the combined getter and setter we emit for static
member variables. Reverting while I figure out how to handle that.
This reverts commit a277748870.