Commit graph

23,265 commits

Author SHA1 Message Date
William S Fulton
58324db9d2 Merge branch 'patch-5'
* patch-5:
  build: harden nuget.yml permissions
2022-11-05 09:50:55 +00:00
William S Fulton
52edda64c1 Fix infinite loop handling non-type template parameters
Fixes infinite loop due to () brackets in a non-type template
parameter containing an expression

Fixes #2418

Non-trivial expressions are still not qualified properly though.
2022-11-05 08:41:10 +00:00
William S Fulton
973590ff91 R rtypecheck typemaps
Further switch to use rtypecheck typemaps instead of hard coded logic.
The full switch to typemaps is deferred until swig-4.2 as it can't be fully
backwards compatible. For now a warning is provided to help the
transition. It provides the full typemap that should be placed into
a user's interface file, for example:

%typemap("rtype") int32_t * "integer"
void testmethod(int32_t * i);
void testmethod();

If there is no rtypecheck typemap for int32_t *, the warning shown is:

example.i:7: Warning 750: Optional rtypecheck code is deprecated. Add the
following typemap to fix as the next version of SWIG will not work without it:
%typemap("rtypecheck") int32_t * %{ (is.integer($arg) || is.numeric($arg)) %}

The warning is shown for any code that previously used "numeric", "integer" or
"character" for the rtype typemap. Copying the rtypecheck typemap as
shown into the user interface file will provide the appropriate fix and
the warning will disappear. This is important to do as swig-4.2 will
not be able to provide this helpful warning.
2022-11-05 08:40:26 +00:00
William S Fulton
d6d83f4df4 Overloading fixes for R and rtypecheck typemap
- Fix for special variable $argtype expansion in rtypecheck typemap.
- Remove unnecessary () brackets when using rtypecheck typemap for
  single parameter functions.
- Add rtypecheck typemaps for shared_ptr so that NULL can be used
  in overloaded functions taking shared_ptr.
2022-11-05 08:40:26 +00:00
William S Fulton
f2da4f2ade Improve R wrapper error message calling overloaded methods
when incorrect types passed are passed to the overloaded methods.

Old unhelpful error message:
  Error in f(...) : could not find function "f"

Example of new improved error message:
  Error in use_count(k) :
    cannot find overloaded function for use_count with argtypes (NULL)
2022-11-05 08:40:19 +00:00
William S Fulton
9e7610f972 Fix memory leak in R shared_ptr wrappers
Fix leak when a cast up a class inheritance chain is
required.

Adds implementation of SWIG_ConvertPtrAndOwn for R.

Closes #2386
2022-11-05 08:32:05 +00:00
William S Fulton
24b0e68391 li_boost_shared_ptr testcase for R
Synchronise test with Python version of testcase
2022-11-05 08:02:59 +00:00
William S Fulton
ed09dd948f cpp11_attribute_specifiers testcase warning suppression 2022-11-05 08:02:59 +00:00
William S Fulton
fe2d781b42 Bump version to 4.2.0 and migrate CHANGES to CHANGES.current 2022-11-04 20:09:13 +00:00
Clinton Stimpson
1f40d38e56 Use more portable PyUnicode_AsUTF8* methods.
This supports the use of Py_LIMITED_API and also uses
PyUnicode_AsUTF8AndSize if Py_LIMITED_API is set to 3.10 or newer.
2022-11-01 07:54:58 +13:00
Olly Betts
df716b8f00 Document that -php7 is for PHP 7 *or later*
This was already in the manual, but not in -help output.

Fixes #2420
2022-10-31 13:41:10 +13:00
Alex
62e27bb616 build: harden nuget.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-10-30 22:48:14 +02:00
Julien Schueller
96f2235d6d CMake: Fix -swiglib on win32
- swig library files must be installed relatively to the exe into PREFIX/bin/Lib
- unset SWIG_LIB_WIN_UNIX else swiglib returns a list of 2 paths which
  break cmake detection (and consistent to the provided windows binaries)
2022-10-26 09:25:14 +02:00
William S Fulton
1e99e4fe37 R shared_ptr testing
Enable more tests.
Use preferred member variable access.
2022-10-24 23:03:47 +01:00
AndLLA
76f004766d enable tests working after master merge 2022-10-24 23:03:47 +01:00
Zackery Spytz
899c9b819e Modify some CHANGES entries that weren't written by me
[skip ci]
2022-10-25 10:16:07 +13:00
William S Fulton
c9dcd0ee78 Add SWIG-4.1.0 release date 2022-10-24 19:47:03 +01:00
William S Fulton
a5b4a4389c Merge branch 'rfix-cleaned-up'
* rfix-cleaned-up:
  Whitespace cleanup in R testcase
  R shared_ptr fixes
  align implementation of smartname to r class name
  enable test for pointerreftest fixed by 752b7e8
  switched implementation reference from java to python
  fixes from code review
  enable li_boost_shared_ptr in r-test-suite
  typo in comment
  fix naming of RClass when template of a shared_ptr
2022-10-24 19:39:34 +01:00
William S Fulton
d238d109c9 Whitespace cleanup in R testcase 2022-10-24 19:38:01 +01:00
William S Fulton
6c4dcbb8fe R shared_ptr fixes
Fix problems in shared_ptr wrappers where the class names were
not consistent when using the shared_ptr template or the actual
underlying type. Move $R_class substitution to typemaps.

Issue #2386
2022-10-24 19:37:56 +01:00
William S Fulton
4a8f7a9c46 Visual C++ warning fixes 2022-10-24 18:43:31 +01:00
AndLLA
0fec14ba34 align implementation of smartname to r class name 2022-10-24 18:20:10 +01:00
AndLLA
deb8664165 enable test for pointerreftest fixed by 752b7e8 2022-10-24 18:20:10 +01:00
AndLLA
0d0e369aaf switched implementation reference from java to python 2022-10-24 18:20:10 +01:00
AndLLA
b885c22f11 fixes from code review 2022-10-24 18:20:10 +01:00
AndLLA
ba96783d11 enable li_boost_shared_ptr in r-test-suite 2022-10-24 18:20:10 +01:00
AndLLA
b15e058a27 typo in comment 2022-10-24 18:20:10 +01:00
AndLLA
a71bb2bc6e fix naming of RClass when template of a shared_ptr 2022-10-24 18:20:10 +01:00
William S Fulton
38c2c15e61 Merge branch 'MSB8027'
* MSB8027:
  CMake: Avoid including parser.c twice
  Fix -Wunused-variable warning
2022-10-24 16:28:29 +01:00
William S Fulton
6370fab025 R - fix $typemap() for R specific typemaps
Add support for special variable replacement in the $typemap()
special variable macro for R specific typemaps (rtype, rtypecheck,
scoercein, scoereout).
2022-10-24 16:27:54 +01:00
William S Fulton
1d73341aa4 Polymorphism in R wrappers fixed for C++ structs 2022-10-24 08:56:55 +01:00
Julien Schueller
2f3fb6a52f CMake: Avoid including parser.c twice
Closes #2409
2022-10-24 09:34:13 +02:00
Julien Schueller
0d523d337d Fix -Wunused-variable warning 2022-10-24 09:34:10 +02:00
Olly Betts
cfd2557cda Revert "[js] Add mod_runme.js"
This reverts commit ea514c3961.

The new runme.js isn't used for node because it fails to run
multicpptest testcases, but was failing for jsc in CI.

The first problem is the new file is missing `new` where the two
objects are created, but fixing that reveals that this testcase
is currently broken for Javascript so just revert for now.
2022-10-20 11:42:27 +13:00
Olly Betts
f40658c2d0 [python] Avoid undefined behaviour
Cast a parameter type explicitly rather than implicitly by casting
the function pointer type, as the latter is undefined behaviour.

Caught by ubsan.
2022-10-20 10:37:47 +13:00
Olly Betts
a5bc48afea [Lua] Fix type resolution between SWIG-wrapped modules
See #2126
2022-10-20 10:14:59 +13:00
Olly Betts
867e49d7c5 [Ocaml] Add mod_runme.ml
See #2126
2022-10-19 07:42:11 +13:00
Olly Betts
ea514c3961 [js] Add mod_runme.js
See #2126
2022-10-19 07:35:53 +13:00
Olly Betts
76b700d2e0 CHANGES: Add blank line before 4.0.0 2022-10-19 07:35:31 +13:00
William S Fulton
01627edaff Remove C++11 from li_std_vector_vector testcase 2022-10-18 08:05:49 +01:00
Olly Betts
747a6a264f [php] Fix handling of multi-module cases
Look up unknown base classes using SWIG_MangledTypeQueryModule().

Revert to using SWIG_TypeCheck() instead of SWIG_TypeCheckStruct()
as the latter doesn't seem to work for this case (at least for PHP
right now).

Add mod_runme.php as a regression test for this.

Adjust the PHP test harness not to set up reflection for the module
unless it's actually needed for a testcase.  Currently the approach
to find the module name doesn't work for multi-module testcases.

See #2126
2022-10-18 10:28:17 +13:00
William S Fulton
d8a0286012 R - Add support for std::vector<std::vector<std::string>>
Closes #2385
2022-10-17 20:14:45 +01:00
William S Fulton
d58eb86821 Testcase warning fix
Workaround for seemingly bogus warning: ‘<unnamed>[0]’ may be used uninitialized [-Wmaybe-uninitialized]
2022-10-15 14:58:26 +01:00
William S Fulton
e622a708d2 Fix Javascript node test-suite to use desired c++ standard
Passes the -std determined in configure.ac to node-gyp
2022-10-15 14:58:25 +01:00
William S Fulton
4c86f45c54 Fix for Java 7 - std::set and std::unordered_set 2022-10-15 14:57:30 +01:00
William S Fulton
1c70dbdb6c Bump doc version to SWIG-4.1 2022-10-15 00:28:09 +01:00
William S Fulton
7be1217d3e Allow wkhtmltopdf to access current directory
Fix for version 0.12.6, see https://github.com/wkhtmltopdf/wkhtmltopdf/issues/4536
2022-10-15 00:28:04 +01:00
William S Fulton
0e60d6b7a4 Correct new Raise functions to be static 2022-10-14 22:51:26 +01:00
William S Fulton
fd2420cdcc Remove STRING_VALUE to keep supporting older versions of R
STRING_VALUE does not work with R_NO_REMAP
in older versions (it broke 3.0.2)
2022-10-14 22:49:07 +01:00
William S Fulton
15c433c5f9 C89 fixes 2022-10-14 22:34:18 +01:00