summaryrefslogtreecommitdiff
path: root/Source/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Parse storage class more flexiblyparse-storage-class-flexiblyOlly Betts2023-05-115-14/+14
| | | | | | | | | | | | | Previously we had a hard-coded list of allowed combinations in the grammar, but this suffers from combinatorial explosion, and results in a vague `Syntax error in input` error for invalid combinations. This means we now support a number of cases which are valid C++ but weren't supported. Fixes #302 Fixes #2079 (friend constexpr) Fixes #2474 (virtual explicit)
* Removed unused default parameter valueOlly Betts2023-05-081-1/+1
|
* [PHP] Wrap method with both static and non-static overloadsOlly Betts2023-05-081-1/+18
| | | | | | | | | | | We now wrap this as a non-static method in PHP, which means the static form only callable via an object. Previously this case could end up wrapped as static or non-static in PHP. If it was wrapped as static, attempting to call non-static overloaded forms would crash with a segmentation fault. See #2544
* [D] Fix typo in -d2 option descriptionOlly Betts2023-05-041-1/+1
|
* Drop D version 1Erez Geva2023-05-041-16/+8
| | | | See #2538
* Fix typo: "temporal" which should be "temporary"Olly Betts2023-04-271-1/+1
|
* try to ninja fix jscMomtchil Momtchev2023-04-261-1/+6
| | | | I don't have access to jsc atm
* take into account numinputs when counting argumentsMomtchil Momtchev2023-04-261-15/+9
|
* [js] Turn on C++ output for node tooOlly Betts2023-04-221-8/+4
| | | | | | | | | Nodejs is like V8 and needs C++ output enabled when wrapping C code. The testsuite was masking this bug by using SWIG options `-v8 -DBUILDING_NODE_EXTENSION=1` rather than `-node` when testing with nodejs, while the javascript examples currently all seem to all get processed with -c++.
* use the renamed name when creating a constantMomtchil Momtchev2023-04-221-2/+1
|
* Remove remaining traces of PHP7 supportOlly Betts2023-04-201-13/+1
| | | | | The bulk of this was already removed in e3b112c69ceed5c39cb07fa45a3ba62b27712679.
* scilab: add a gateway xml v6 with full function namesClément DAVID2023-04-201-4/+61
|
* Remove support for PHP7Olly Betts2023-04-142-3/+4
| | | | | PHP7 security support ended 2022-11-28 so it doesn't make sense to include support for it in the SWIG 4.2.x release series.
* Duplicate parameter name handling improvementsWilliam S Fulton2023-02-181-2/+7
| | | | | | | | | | | | | When a method with duplicate parameter names is wrapped such as: void fn_3parms(int p_a, int p_a, double p_c); Previously all duplicate parameter names were changed in order to provide unique parameter names: void fn_3parms(int arg0, int arg1, double p_c) Now the parameter names changed are just the 2nd and subsequent duplicate parameter names: void fn_3parms(int p_a, int arg1, double p_c)
* Improved variadic parameter names expansionWilliam S Fulton2023-02-181-17/+10
| | | | | | | | | | | | | | | | | Number the variadic parm names instead of not naming them. Such as: template<typename... T> int variadicmix1(T... t) { return 20; } %template(variadicmix1) variadicmix1<A,B,C>; Used to expand to: int variadicmix1(A T, B arg1, C arg2) now: int variadicmix1(A t1, B t2, C t3) Also test for generating duplicate parameter names which required a fix in R. Also results in a few minor changes to parameter names in generated R code.
* Avoid unused parameter self warningJulien Schueller2023-01-271-1/+1
|
* Ocaml name mangling fixWilliam S Fulton2022-11-291-0/+3
| | | | Fixes testcase template_expr which was resulting in OCaml syntax errors.
* SwigType * handling corrections - Python builtin manglingWilliam S Fulton2022-11-181-19/+27
| | | | | | | | | | | | Further corrections to pass SwigType * to methods expecting types instead of passing readable type strings. Swig_string_mangle() takes a generic String *, but it was calling functions that require SwigType *. Swig_string_mangle_type() is now provided for SwigType *. The previous commit is a pre-requisite in order to prevent duplicate symbols from being generated in the C++ wrappers.
* Duplicate class template instantiations via %template changesWilliam S Fulton2022-11-181-0/+1
| | | | | | | | | | | Named duplicate class template instantiations now issue a warning and are ignored. Duplicate empty class template instantiations are quietly ignored. The test cases are fixed for this new behaviour. This commit is a pre-requisite for the near future so that the Python builtin wrappers can correctly use the SwigType_namestr function without generating duplicate symbol names.
* Minor refactor of D, C#, Java director codeWilliam S Fulton2022-11-123-34/+51
| | | | | for overloaded methods. Fixes regression (crash) in director_ignore D testcase since string mangling names change.
* Consolidate name mangling functionsWilliam S Fulton2022-11-129-17/+17
| | | | | | Swig_string_mangle => Swig_name_mangle_string Swig_name_mangle => Swig_name_mangle_string Swig_string_mangle_type => Swig_name_mangle_type
* Remove unused code in mzscheme.cxxWilliam S Fulton2022-11-121-6/+0
|
* SwigType * handling corrections - manglingWilliam S Fulton2022-11-124-12/+14
| | | | | | | | | | Further corrections to pass SwigType * to methods expecting types instead of passing readable type strings. Swig_string_mangle() takes a generic String *, but it was calling functions that require SwigType *. Swig_string_mangle_type() is now provided for SwigType *r. The special template handling on types now occurs in this function.
* SwigType * handling correctionsWilliam S Fulton2022-11-096-58/+94
| | | | | | | | | Further corrections to pass SwigType * to methods expecting types instead of passing readable type strings. Required reworking code that adds a fake inheritance for smart pointers using the smartptr feature. Swig_smartptr_upcast() added as a support function for this.
* R rtypecheck typemapsWilliam S Fulton2022-11-051-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Overloading fixes for R and rtypecheck typemapWilliam S Fulton2022-11-051-9/+12
| | | | | | | | - 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.
* Improve R wrapper error message calling overloaded methodsWilliam S Fulton2022-11-051-5/+7
| | | | | | | | | | | 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)
* Document that -php7 is for PHP 7 *or later*Olly Betts2022-10-311-1/+1
| | | | | | This was already in the manual, but not in -help output. Fixes #2420
* Merge branch 'rfix-cleaned-up'William S Fulton2022-10-241-34/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * R shared_ptr fixesWilliam S Fulton2022-10-241-40/+0
| | | | | | | | | | | | | | | | 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
| * align implementation of smartname to r class nameAndLLA2022-10-241-16/+11
| |
| * fixes from code reviewAndLLA2022-10-241-2/+1
| |
| * typo in commentAndLLA2022-10-241-1/+1
| |
| * fix naming of RClass when template of a shared_ptrAndLLA2022-10-241-3/+15
| |
* | Visual C++ warning fixesWilliam S Fulton2022-10-241-2/+2
|/
* Merge branch 'MSB8027'William S Fulton2022-10-241-0/+1
|\ | | | | | | | | | | * MSB8027: CMake: Avoid including parser.c twice Fix -Wunused-variable warning
| * Fix -Wunused-variable warningJulien Schueller2022-10-241-0/+1
| |
* | R - fix $typemap() for R specific typemapsWilliam S Fulton2022-10-241-1/+11
| | | | | | | | | | | | Add support for special variable replacement in the $typemap() special variable macro for R specific typemaps (rtype, rtypecheck, scoercein, scoereout).
* | Polymorphism in R wrappers fixed for C++ structsWilliam S Fulton2022-10-241-4/+2
|/
* [php] Fix handling of multi-module casesOlly Betts2022-10-181-2/+7
| | | | | | | | | | | | | | | | 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
* [R] Run destructors of local C++ objects on SWIG_failOlly Betts2022-10-141-0/+8
| | | | | | | | | Arrange that destructors of local C++ objects in the wrapper function get run on SWIG_fail (which calls Rf_error() which calls longjmp()). We achieve this by putting almost everything in the function in its own block, and end that right before Rf_error() at which point those destructors will get called.
* [lua] Run destructors of local C++ objects on SWIG_failOlly Betts2022-10-141-4/+12
| | | | | | | | | Arrange that destructors of local C++ objects in the wrapper function get run on SWIG_fail (which calls lua_error() which calls longjmp()). We achieve this by putting almost everything in the function in its own block, and end that right before lua_error() at which point those destructors will get called.
* Revert "[xml] Move to "Experimental" target language status"William S Fulton2022-10-131-1/+1
| | | | | | | | This reverts commit 22a4355f340e9a844d5e5d8d0528d767c4808ebb. Conflicts: CHANGES.current RELEASENOTES
* Cleanup SWIG_VERSION definitionWilliam S Fulton2022-10-1318-41/+28
| | | | | | | | | | | | | Add Swig_obligatory_macros which must be called by each target language to define SWIG_VERSION correctly in the generated code, as well as the language specific macro SWIGXXX where XXX is the target language name. Drop the #ifdef SWIGXXX that was previously generated - I can't see the point of this and if users are defining this macro somehow, then users will need to change this Closes #1050
* XML whitespace changesWilliam S Fulton2022-10-101-13/+13
| | | | Remove non-conventional whitespace before closing tag with '>'.
* OCaml director return fixWilliam S Fulton2022-10-101-11/+4
| | | | Fixes director_unwrap_result testcase when returning Element *const *&
* Improve director unwrap detection for the return typeWilliam S Fulton2022-10-104-42/+42
| | | | | | | | | | | | | Resolve the return type to correctly determine if the type is a pointer or reference to a director class. SwigType_refptr_count_return() recently added as a simpler fix is no longer needed. The conventional approach of using the "type" rather than "decl" to analyse the return type is used instead too. Issue #1823
* Merge branch 'director-unwrap-result'William S Fulton2022-10-072-6/+2
|\ | | | | | | | | * director-unwrap-result: Unwrap director classes only when returning a pointer or reference to an object
| * Merge branch 'master' into director-unwrap-resultOlly Betts2022-03-0132-14315/+1688
| |\
| * | Unwrap director classes only when returning a pointer or reference to an objectThomas Reitmayr2020-06-202-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This involves properly counting the number of references and pointers in the return type of a function and only generate unwrapping code if this number is 1. For template instances some post-processing code is added to fix the 'decl' and 'type' attributes of functions if changed in an unfavorable way during template expansion. This commit fixes swig#1811.