Commit graph

22,395 commits

Author SHA1 Message Date
Olly Betts
499fb74707 Remove unused Printf parameters 2021-12-18 11:24:00 +13:00
Olly Betts
4672318b42 Make some generated variables static 2021-12-17 22:32:34 +13:00
Olly Betts
cf802c63f2 Improve naming of zend_class_entry structs
Previously the zend_class_entry for Foo was named SWIGTYPE_Foo_ce, but
this can collide in some cases - e.g. if there's a class named p_Foo
then its zend_class entry will be SWIGTYPE_p_Foo_ce, but that's the same
as the swig_type_info for a class named p_Foo_ce.
2021-12-17 17:14:54 +13:00
Olly Betts
f976927d52 Fix source code comment typo 2021-12-17 14:54:05 +13:00
Olly Betts
78f5404727 Improve generated object handlers
Do more initialisation at module load time.

Use a shared set of handlers for cases when the C/C++ object is
destroyed with free().

Most of the code in the free_obj and create_object handlers is the
same for every wrapped class so factor that out into common functions.
2021-12-17 14:50:49 +13:00
Olly Betts
5da86a1413 Make some generated functions static 2021-12-17 09:38:44 +13:00
Olly Betts
6253583809 Rename php_fetch_object with swig_ prefix
We shouldn't be using symbols starting `php` as that risks collisions
with future symbols defined by PHP.
2021-12-17 09:37:00 +13:00
Olly Betts
9ffa15b307 Tweak source whitespace to match SWIG conventions 2021-12-15 19:40:06 +13:00
Olly Betts
6ef820acf9 [php] Simplify creating overload dispatch name 2021-12-15 19:30:17 +13:00
Olly Betts
7418da9e5d Fix transposed outputs in internals doc 2021-12-15 19:25:53 +13:00
tytan652
fa2f9dc5da [lua] Fix maybe-uninitialized warning in generated code 2021-12-15 09:31:13 +13:00
Olly Betts
98b8578731 [php] Tidy up code which processes in typemaps
The only functional change is that we now recover after
WARN_TYPEMAP_IN_UNDEF better (or at least like most of the other
SWIG backends do).
2021-12-13 16:02:12 +13:00
Olly Betts
4c7febfb80 Make DOH Char macro more robust
For example, `Char(foo)[0]` now works to get the first character
of DOH String `foo`.

Previously this gave a confusing error because it expanded to
`(char *) Data(foo)[0]` and the `[0]` binds more tightly
than the `(char *)`.
2021-12-13 09:33:26 +13:00
Olly Betts
94ad89284d [php] Remove redundant in typemap for bool
This typemap which would wrap C++ bool as PHP int is later overridden
by another which wraps it as PHP bool.  The current result is what
we want so just remove the redundant one.
2021-12-13 09:31:11 +13:00
Olly Betts
b78f0ee263 [php] Add runme for long_long testcase 2021-12-13 09:30:42 +13:00
Olly Betts
48bb7e0e95 Simplify PHP backend code 2021-12-13 09:27:58 +13:00
Olly Betts
7d70402306 Update PHP source comment
We no longer wrap anything as a PHP resource.
2021-12-13 09:27:58 +13:00
Olly Betts
bf68b377e6 Remove unused code from PHP backend
These are leftovers from the work on wrapping using only PHP's C API.
2021-12-13 09:27:58 +13:00
Olly Betts
4467c94fe9 Fix removeNode() to really unset previousSibling
There was a typo in attribute name so we attempted to remove the
non-existent attribute prevSibling instead.
2021-12-10 18:34:21 +13:00
Olly Betts
fd013c344a [php] Remove unused variable
SWIG_module_entry hasn't actually been used for any of git history
which is over 19 years.
2021-12-10 17:10:35 +13:00
Olly Betts
c60507ef70 [php] configure: Check for php8.1 binary 2021-12-08 13:10:38 +13:00
Olly Betts
c0c7a8dba0 [php] Fix two incorrect PHP 8 conditionals
The correct macro to test is PHP_MAJOR_VERSION so these two PHP 8 cases
weren't ever used, which hid that the PHP8 version of the code was
broken in one of them.

Highlighted in #2113.
2021-12-08 13:10:38 +13:00
William S Fulton
7246cfa6c6
Merge pull request #2116 from vstinner/python311
Add Python 3.11 support: use Py_SET_TYPE()
2021-12-07 20:32:31 +00:00
Victor Stinner
e902ab5160 Add Python 3.11 support: use Py_SET_TYPE()
On Python 3.9 and newer, SwigPyBuiltin_SetMetaType() now calls
Py_SET_TYPE(). Py_TYPE() can no longer be usd as an l-value on
Python 3.11:

* https://docs.python.org/dev/c-api/structures.html#c.Py_SET_TYPE
* https://docs.python.org/dev/whatsnew/3.11.html#c-api-changes
2021-12-06 23:17:33 +01:00
William S Fulton
e0935404a8 Add Octave 6 to changes file 2021-12-05 22:31:05 +00:00
William S Fulton
5ada46bcce Whitespace consistency fix in CI-linux-install.sh 2021-12-05 22:26:25 +00:00
William S Fulton
3947df87a2 GHA: Test Octave 6.4 2021-12-05 22:24:51 +00:00
Robert Fries
983b91694f Additional changes due to name changes in octave-6 * is_map to isstruct, is_object to isobject 2021-12-05 22:19:46 +00:00
Robert Fries
81f9e6600f Octave module lets examples and tests work with Octave-6 * Try-catch replacement for check of error_state * Add execute method in addition to call * Replace oct_mach_info with octave::mach_info * Call from interpreter: global_varval global_assign * Assign a global name requires locating the stack which requires interpreter to tree evaluator to callStack * Do not use discard_error_messages or discard_warning_messages 2021-12-05 22:19:46 +00:00
Robert Fries
852eab7db3 Allow swig wrapped modules to compile with -Bsymbolic 2021-12-05 22:19:40 +00:00
Olly Betts
883b42dc70 [php] Ensure _runme.php calls check::done()
This function doesn't do anything currently so these missing calls are a
latent issue.  It could be used for e.g. memory leak checking in the
future though, and it's potentially a useful place to add code when
debugging.
2021-12-05 12:40:44 +13:00
Olly Betts
ee3c9bd697 [php] Check fooCount() in newobject1_runme.php 2021-12-05 12:40:44 +13:00
William S Fulton
8432d3f89b GHA: Test currently supported php versions 7.0-8.1 2021-12-04 09:35:51 +00:00
William S Fulton
5bdc20781b Remove bom in Windows.html 2021-12-02 11:53:13 +00:00
William S Fulton
a5f85beb2d HTML doc fixes 2021-12-02 11:38:41 +00:00
William S Fulton
e2384796f0 Add Python embedded interpreters fix to changes file 2021-12-02 09:01:31 +00:00
William S Fulton
be51cb6a6e Merge branch 'fix-crash-2101'
* fix-crash-2101:
  Added extern "C" block that was removed in previous commit.
  Fixed crashes when using embedded Python interpreters.
2021-12-02 09:01:18 +00:00
Olly Betts
c25df74807 [php7] Use destructor action if present
If there's a destructor, use its action instead of free(ptr)
(for C)/delete ptr (for C++).

Fixes #2108
2021-12-02 19:15:34 +13:00
Olly Betts
51f586bc4c
Merge pull request #2111 from swig/remove-obsolete-js-support
Remove obsolete js support
2021-12-02 18:09:30 +13:00
Olly Betts
bebb3d4c21 [ci] Remove CI build for unsupported v8 3.14
We only support v8 5.0 and later now.

libv8-dev is no longer packaged in newer Ubuntu releases, so it
seems there isn't an easy way to update this to test a supported
v8 version, but really v8 via node is the configuration people will
actually use anyway.
2021-12-02 14:31:28 +13:00
Olly Betts
7c97bd5ab3 [js] Remove code to handle v8 < 5.0
We require at least node v6 which means v8 5.0, so code to handle
older v8 is no longer useful.
2021-12-02 14:04:25 +13:00
Olly Betts
e30dfeaab9 [js] Update docs re v8 support
We require at least node v6 (which means v8 v5.0) since
7ba19e7586 so updated the manual to
reflect this.
2021-12-02 14:01:27 +13:00
John Senneker
160b8c5da3 Added extern "C" block that was removed in previous commit. 2021-12-01 15:15:24 -05:00
William S Fulton
f17b6bda93 Merge branch 'fix_SWIG_V8_VERSION'
* fix_SWIG_V8_VERSION:
  [javascript][v8] SWIG_V8_VERSION generation method corrected.
2021-12-01 18:22:29 +00:00
William S Fulton
26d693105a GHA: Test node versions 6,8,10
Test the documented minimum version 6 and some later versions
as was done on Travis.

Using ubuntu-18.04 as I couldn't get these versions to work on newer
ubuntu-20.04 (some horrid c++ compilation errors)
2021-12-01 18:21:07 +00:00
John Senneker
ebe14e6e2a Fixed crashes when using embedded Python interpreters.
Fixes #2101. There are 3 related changes made here:
1. Move the SWIG_globals() singleton into pyrun from pyint so it
   is visible to SWIG_Python_DestroyModule(). The static globals
   varlink has been extracted out of the function so that it can
   be set to NULL in SWIG_Python_DestroyModule(), which fixes the
   issue described in #2101. (Now when the second interpreter
   starts up, the Swig_Globals_global pointer will be NULL, so it
   knows it has to create a new one.)
2. Remove a Py_DECREF on the globals varlink. The decrement is now
   performed by DestroyModule(), so there's no need to do it in
   SWIG_init().
3. Fixed similar issue with SWIG_Python_TypeCache().
2021-11-30 16:13:17 -05:00
William S Fulton
0304bdb82b GHA: Add testing of node 17
Also remove duplicate test of node 14
2021-11-27 13:56:49 +00:00
Vadim Zeitlin
6a56426f8f Use JSC version available in Ubuntu 20.04 in the CI builds
Use the newer OS and JavaScript Core library versions for the CI build,
we don't have to remain with the old version here, as the newer one
works too.
2021-11-27 13:51:34 +00:00
William S Fulton
a39c2695f2
Merge pull request #2100 from rex4539/typos
Fix typos
2021-11-24 18:41:26 +00:00
William S Fulton
3354345255 GHA: switch ocaml testing to ubuntu-18.04 2021-11-17 22:27:00 +00:00