Commit graph

22,446 commits

Author SHA1 Message Date
Olly Betts
87c2e7d71a [php] Fix long long handling on 32 bit platforms
The typemaps for long long and unsigned long long didn't handle a
string input correctly, and long_long_runme.php had a flawed test
in this case.

Fixes #2155
2022-01-22 13:09:34 +13:00
Olly Betts
9b10534879 [php] Make internal function wrappers static 2022-01-22 13:03:58 +13:00
Olly Betts
1c76000e38 [php] Add type declarations for optional params too
See #2151
2022-01-21 16:34:59 +13:00
Olly Betts
5d0679668d [tcl] Drop remnants of support for Tcl < 8
The documented minimum has been Tcl 8.0 since before the great
merge in 2002.
2022-01-21 15:54:06 +13:00
Olly Betts
4f5dfd596d [php] Provide zend_class_implements_interface() for 7.x
It seems instanceof_function_ex() isn't a viable option for PHP 7.3 and
earlier - the implementation is strangely wrong.

So let's just provide a compatibility implementation which does what
zend_class_implements_interface() does in 8.x and use that for all 7.x
so there are fewer variants to worry about testing.
2022-01-21 14:32:36 +13:00
Olly Betts
91470ca62d [php] Actually generate parameter type declarations 2022-01-21 13:27:54 +13:00
Olly Betts
772ea68084 [php] Fix minor version test 2022-01-21 13:09:47 +13:00
Olly Betts
c197ed719a Fix unterminated comment in previous commit
I'm an idiot - I noticed I'd used a // comment after testing, but failed
to retest after fixing that.
2022-01-21 12:34:38 +13:00
Olly Betts
ce4a9923ed [php] Fix zend_class_implements_interface() compat
The sense of parameter 3 of instanceof_function_ex() appears to have
changed in PHP 7.4 and we need to pass 0 for older versions and 1 for
PHP 7.4.  Words fail me.
2022-01-21 12:11:39 +13:00
Olly Betts
4d3d4839b0 [python] Add multivalue_runme.py 2022-01-21 11:10:30 +13:00
Olly Betts
d43f28a666 [php] Use -prefix setting in type declarations 2022-01-21 11:08:24 +13:00
Olly Betts
c417250b4e [php] Allow testing if an object is SWIG-wrapped
Since the switch to wrapping classes using PHP's C API, we now
internally need to be able to tell if a PHP object is of or derived
from a class that is wrapped by SWIG so we know if we can offset the
zend_object pointer to get to the swig_object_wrapper.  If we try to
do this to an object which isn't wrapped by SWIG then we invoke C/C++
undefined behaviour (and typically get a segmentation fault).

This check is implemented by having a SWIG\wrapped empty interface which
we make all SWIG-wrapped classes implement simply so we can test for it
to detect such classes.

Fixes #2125
2022-01-20 14:42:02 +13:00
Olly Betts
0cfc750d44 CHANGES.current: Add entry for previous commit 2022-01-20 10:17:57 +13:00
Olly Betts
1f1349741f
[php] Generate PHP type declarations
We now automatically generate PHP type declarations for PHP >= 8.0.

The generated code still compiles with PHP 7.x but without type declarations.
2022-01-20 10:07:44 +13:00
William S Fulton
76d5a9ec27 gcc-12 warning fix in test-case
Closes #2145
2022-01-18 21:37:02 +00:00
Olly Betts
748a9a5452 [perl] Require at least Perl 5.8.0
As discussed and agreed in #1629, it's become hard to test with Perl
5.6 or earlier, such old versions are no longer in active use, and
4.1.0 is an appropriate time to make such a change.

I've dropped the compatibility code that was obvious to me, but there's
probably more that can be cleaned up now.
2022-01-19 10:07:30 +13:00
William S Fulton
8c608d646c Fix Appveyor mingw builds - install autotools 2022-01-18 21:03:21 +00:00
William S Fulton
c8645aab9e Ensure GHA fails when testflags.py fails 2022-01-18 21:03:21 +00:00
Olly Betts
c839066405 [perl] Document explicitly not to use %OWNER directly
See #1771
2022-01-18 14:53:02 +13:00
Olly Betts
45c1255933 Fix missing HTML escaping in Octave docs 2022-01-18 13:56:07 +13:00
Olly Betts
0fbf23a77b Fix PHP docs formatting issue 2022-01-16 12:36:05 +13:00
William S Fulton
2272d00c1a Add Python testcase for testing flatstaticmethod syntax
For testing legacy flattened static method access for when
issue #2137 is applied.
2022-01-15 00:05:06 +00:00
William S Fulton
3aa302c08f %callback and Python class access for C++ static member functions fixes
Fix access to C++ static member functions using Python class
staticmethod syntax, such as Klass.memberfunction instead of
Klass_memberfunction, when using -fastproxy and -builtin in
combination with %callback.

The docstring containing the callback pointers were not being patched
during module initialisation.
2022-01-14 23:00:59 +00:00
William S Fulton
627f7214db [Python] Add missing Python kwargs builtin support
Accept keyword arguments accessing C++ static member functions when
using -builtin and kwargs feature and Python class staticmethod syntax.
The missing keyword argument support was only when using the
class staticmethod syntax, not when using the flat static method
syntax.
2022-01-14 23:00:42 +00:00
William S Fulton
cf8788c411 Update Python tests to not use flatstaticmethod access
Use Python class staticmethod syntax to access C++ static member functions,
such as Klass.memberfunction, instead of Klass_memberfunction.
Examples and test-suite changes in preparation for issue #2137.
2022-01-14 22:48:11 +00:00
Vadim Zeitlin
7610997209 Stop using Travis CI which doesn't work any longer
Unfortunately Travis CI can't be used for building open source projects
any longer in practice, as extra credits must be manually requested
every time from Travis support, which is just infeasible, as this would
need to be done every couple of days if not more often, and support
reply time is anything from a couple of days to more than a month.

So stop even trying to use it, as it doesn't work anyhow, and switch to
using GitHub Actions only.

Closes #2067
2022-01-10 20:31:28 +00:00
William S Fulton
b98c78441f GHA debug via ssh info 2022-01-10 20:13:16 +00:00
William S Fulton
3200a815d4
Merge pull request #2095 from vadz/extend-suffix
Use suffix for static methods added by %extend
2022-01-08 21:11:14 +00:00
William S Fulton
0a400f5230 Building distribution fixes and pcre version display
[skip-ci]
2022-01-08 19:23:02 +00:00
William S Fulton
3530b3356c Add recent change to changes file 2022-01-08 16:29:18 +00:00
ERROR
d73f933c4b
Support std::array in Golang (#2045)
Support std::array in Golang

Closes #2045
2022-01-04 12:12:56 +13:00
Olly Betts
48eba82ac8 Remove obsolete code to set SWIG_V8_VERSION
We've dropped support for the old V8 versions which lacked version
macros, and SWIG_V8_VERSION now gets automatically defined by
Lib/javascript/v8/javascriptruntime.swg which will #undef it first if
it's already defined.
2021-12-29 19:16:36 +13:00
Olly Betts
130813b320 Escape a literal > in PHP.html 2021-12-29 19:15:08 +13:00
Olly Betts
9e95f7f996 [php] Add director_ownership_runme.php
This serves as a regression test for
https://sourceforge.net/p/swig/bugs/1339/ which was presumably fixed by
the change to use PHP's C API to wrap classes.
2021-12-29 15:48:40 +13:00
Olly Betts
fa36d6fd28 [python] Add 3.10 to Python versions in configure 2021-12-24 16:43:25 +13:00
Olly Betts
c42e8970a4 [php] Improve wording in the manual 2021-12-24 15:53:00 +13:00
Olly Betts
9f87d81fae Clean up testcase source whitespace 2021-12-23 16:18:07 +13:00
Olly Betts
860731e0ea Remove redundant test cases
With C++ comments changed to C comments, these are now identical to
the two cases just above, aside from the `2` suffix on the names.

Follow-on for #2027.
2021-12-23 11:55:47 +13:00
William S Fulton
2d76057571 preproc_cpp test for testing preprocessor and C++
Move C++ comment testing into here.
See 7a9bf3307f.
2021-12-22 19:06:00 +00:00
Olly Betts
1b22fef8ad [php] Add missing runmes for overload_* testcases 2021-12-22 13:40:29 +13:00
William S Fulton
7a9bf3307f Remove C++ comments from preproc C test
Closes issue #2127
2021-12-21 22:36:42 +00:00
Olly Betts
69b580dfb6 [php] Use SWIG_TypeCheckStruct to check types
We have the swig_type_info available and SWIG_TypeCheckStruct
is more efficient because it uses a pointer comparison instead of the
string comparison SWIG_TypeCheck uses (this change speeds up `make
check-php-test-suite` by about 10%).
2021-12-19 13:45:25 +13:00
Olly Betts
a7f2c3d19b [php] Add overload_simple_runme.php 2021-12-18 18:45:52 +13:00
Olly Betts
7d75e3eb7e [PHP] Add new PHP 8.1 keyword
Add PHP keyword 'readonly' (added in 8.1) to the list SWIG knows to
automatically rename.  This keyword is special in that PHP allows it to
be used as a function (or method) name.
2021-12-18 15:30:38 +13:00
Olly Betts
6f016f3a38 TODO: Remove stale PHP entry
Ref count destroying has worked for years (and is explicitly tested
by swig_exception_runme.php).
2021-12-18 15:01:04 +13:00
Olly Betts
dee8b65823 [php] Always use <?php to start .php file
A few files had just <? which only works when the short_open_tag option
is on.  It is on by default (at least in current PHP versions) and we
explicitly tell PHP not to read php.ini, but the PHP docs recommended to
avoid it, and PHP can be built with --disable-short-tags.
2021-12-18 15:00:56 +13:00
Olly Betts
cc5395a669 [php] Add more checks to some PHP testcases 2021-12-18 14:38:49 +13:00
Olly Betts
f04d741d1c [php] Actually implement abstract_inherit_runme.php
The previous version didn't really test anything useful.  Now we
check that trying to instantiate any of the abstract classes fails
with the expected error.
2021-12-18 14:09:56 +13:00
Olly Betts
847f0a6806 Merge branch 'php-codegen-improvements' 2021-12-18 12:32:22 +13:00
Olly Betts
499fb74707 Remove unused Printf parameters 2021-12-18 11:24:00 +13:00