summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add test that `<(`...`)>` in expression is handledtemplate-in-array-size-fixOlly Betts2023-05-141-4/+5
| | | | | | SWIG uses these internally in type strings so needs to rewrite them when they appear in expressions which get used in a type. This already happens, but really deserves test coverage.
* Fix handling of template in array sizeOlly Betts2023-05-112-14/+6
| | | | | | | | | | This was being rejected by SWIG because the type string contains '<' not followed by '('. That check seems too strict given types can contain constant expressions which can contain '<' characters in several ways, so let's just try removing the check and see what happens. Fixes #2486
* Parse storage class more flexiblyOlly Betts2023-05-1111-62/+170
| | | | | | | | | | | | | | 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 (and missing) 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)
* [doc] Fix SWIG_AsCharPtrAndSize arg typesOlly Betts2023-05-091-1/+1
|
* Initial support for std::string_viewOlly Betts2023-05-0818-11/+994
| | | | | | | So far C#, Java, Lua and PHP are supported. Closes: #2540 See #1567
* Removed unused default parameter valueOlly Betts2023-05-081-1/+1
|
* [PHP] Wrap method with both static and non-static overloadsOlly Betts2023-05-083-1/+45
| | | | | | | | | | | 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
* Tweak to struct name in testcase for RWilliam S Fulton2023-05-062-3/+3
|
* Merge branch 'typedef-namespace'William S Fulton2023-05-065-3/+41
|\ | | | | | | | | | | | | | | | | | | * typedef-namespace: Partial revert of previous commit for typedefs add an unit test tentative fix for typedef/using declaration to struct typedef Conflicts: CHANGES.current
| * Partial revert of previous commit for typedefsWilliam S Fulton2023-05-066-17/+25
| | | | | | | | | | | | | | | | | | | | Setting current symbol table for a typedef seems wrong. No difference to test-suite though. Testcase rename for C++11 testing and minor adjustments. Issue #2550 Closes #2551
| * add an unit testMomtchil Momtchev2023-05-062-0/+28
| |
| * tentative fix for typedef/using declaration to struct typedefMomtchil Momtchev2023-05-061-2/+4
| |
* | Add #366 reference to fix for #1037Olly Betts2023-05-061-2/+2
| |
* | Fix testcase comment typoOlly Betts2023-05-041-1/+1
| |
* | [D] Stop generating Examples/d/example.mkOlly Betts2023-05-042-2/+0
| | | | | | | | We no longer need to now we've dropped D1 support.
* | [D] Fix typo in -d2 option descriptionOlly Betts2023-05-041-1/+1
| |
* | [D] Update docs for D1 removalOlly Betts2023-05-047-13/+17
| |
* | Drop D version 1Erez Geva2023-05-0471-5047/+35
| | | | | | | | See #2538
* | Fix CHANGES.current factual errorOlly Betts2023-04-291-3/+4
| |
* | Fix typo: "temporal" which should be "temporary"Olly Betts2023-04-274-4/+4
| |
* | Allow using snprintf() instead of sprintf() in wrappersOlly Betts2023-04-2722-44/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We aim to produce code that works with C90 or C++98 so we can't assume snprintf() is available, but it almost always is (even on systems from before it was standardised) so having a way to use it is helpful. Enable this automatically if the compiler claims conformance with at least C90 or C++98 and check SWIG_HAVE_SNPRINTF to allow turning on manually, but disable if SWIG_NO_SNPRINTF if defined. The fallback is to call sprintf() without a buffer size check - checking after the call is really shutting the stable door after the horse has bolted, and most of our uses either have a fixed maximum possible size or dynamically allocate a buffer that's large enough. Fixes: #2502 (sprintf deprecation warnings on macos) Fixes: #2548
* | [Lua] Alternative SWIG_LUA_CONSTTAB_INT fixOlly Betts2023-04-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | SWIG_LUA_CONSTTAB_INT can be called with a constant expression containing commas (e.g. `SizeOf< int,int >::size`). This was addressed in b13f584258079dd88a4ca87412b87ac4464686df by making its second argument variadic, but (a) this doesn't work with our baseline of C90/C++98 and (b) the variadic syntax used is a GCC extension which doesn't work with all compilers (e.g. MSVC). We can solve this without needing variadic macros by simply wrapping this argument in an extra pair of parentheses when calling.
* | Revert "Lua variadic templates sizeof... constants fix"Olly Betts2023-04-271-2/+2
| | | | | | | | This reverts commit b13f584258079dd88a4ca87412b87ac4464686df.
* | Merge branch 'python-iterator-protocol'William S Fulton2023-04-2624-582/+149
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * python-iterator-protocol: Finish removal of SwigPySequence_Cont Remove undocumented and non-existent STL std::carray Remove assign method uses by the removed Python Sequence Protocol Remove now redundant use of Python Sequence protocol in STL wrappers Add support for all STL containers to be constructible from a Python set Iterator Protocol support for std::array wrappers STL support for copying Python objects supporting Iterator protocol Closes #2515 Conflicts: CHANGES.current
| * | Finish removal of SwigPySequence_ContWilliam S Fulton2023-04-261-13/+7
| | |
| * | Remove undocumented and non-existent STL std::carrayWilliam S Fulton2023-04-267-218/+0
| | |
| * | Remove assign method uses by the removed Python Sequence ProtocolWilliam S Fulton2023-04-2611-107/+0
| | |
| * | Remove now redundant use of Python Sequence protocol in STL wrappersWilliam S Fulton2023-04-262-252/+1
| | | | | | | | | | | | | | | | | | | | | | | | Removes SwigPySequence_Cont and support classes: SwigPySequence_ArrowProxy, SwigPySequence_Cont, SwigPySequence_Ref The recently added Iterator Protocol support should cover the Sequence Protocol usage for converting from Python containers to STL containers.
| * | Add support for all STL containers to be constructible from a Python setWilliam S Fulton2023-04-268-66/+120
| | |
| * | Iterator Protocol support for std::array wrappersWilliam S Fulton2023-04-262-33/+61
| | | | | | | | | | | | | | | Introduce swig::IteratorProtocol class and assign which can be partially specialized by different container types, such as std::array.
| * | STL support for copying Python objects supporting Iterator protocolWilliam S Fulton2023-04-011-1/+68
| | | | | | | | | | | | std::array not working though
* | | Merge branch 'js-numinputs'Olly Betts2023-04-273-16/+42
|\ \ \
| * | | 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-262-15/+33
| | |/ | |/|
* | | catches_strings_runme.php: Check exact exception messageOlly Betts2023-04-241-2/+2
| | | | | | | | | | | | There's no need to do a substring check here.
* | | [php] Add throws typemaps for string* + const string*Olly Betts2023-04-243-0/+34
| | |
* | | Make typemaps consistently use string::data() vs c_str()Olly Betts2023-04-242-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use c_str() only when we need a terminating zero byte and data() when we don't (as we already did in most cases). The two methods in fact do the same thing as of C++11 (and in practice did for all C++98 implementations I'm aware of) but it's useful to make clear when we need a terminating zero byte and when we don't, for example for adding string_view support (string_view supports data(), but can't support c_str() (since it could be a slice from the middle of a std::string).
* | | [doc] Update sample swig -debug-tags outputOlly Betts2023-04-241-9/+9
|/ / | | | | | | | | The format was changed from that the manual shows in 2010 by 5a3ba0d607132bfe78c5c23b3d8d2694a9250957!
* | Update CHANGES.current for Javascript changesOlly Betts2023-04-231-0/+22
| |
* | [js] Stop using swig -c++ for C examplesOlly Betts2023-04-2322-27/+41
| |
* | [js] Improve default for JSENGINEOlly Betts2023-04-223-17/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the default was always "node", even if nodejs wasn't detected by configure. This leads to a confusing failure from "make check" if you have another support JS engine installed but not node. Now the default it picked based on which engines configure found. If only one was detected, that should be used. If multiple are, you can override the default choice by specifying e.g. ENGINE=jsc on the make command line. Fixes #2453
* | [js] Turn on C++ output for node tooOlly Betts2023-04-222-9/+5
| | | | | | | | | | | | | | | | | | 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++.
* | Add CHANGES.current entryOlly Betts2023-04-221-0/+8
| |
* | use the renamed name when creating a constantMomtchil Momtchev2023-04-221-2/+1
| |
* | [perl,ruby] Test OUTPUT string& typemapOlly Betts2023-04-212-1/+5
| |
* | [lua] Test INPUT,INOUT,OUTPUT for std::string&Olly Betts2023-04-212-1/+7
| |
* | [php] Support INPUT,INOUT,OUTPUT for std::string&Olly Betts2023-04-214-11/+81
| | | | | | | | | | | | | | By default SWIG/PHP wraps std::string& as a pass-by-reference PHP string parameter, but sometimes such a parameter is only for input or only for output, so add support for the named typemaps that other target languages support.
* | Warnings.html: Add missing warning numbers 472,473Olly Betts2023-04-211-0/+2
| | | | | | | | Fixes #2528
* | Fix CanCastAsInteger if errno is set.Markus Wick2023-04-212-3/+9
| | | | | | | | | | | | | | | | | | | | This method checks if the range of the input variable is fine. However if the errno variable was already set, it fails even for valid inputs. This fixes at least some random failures in the python castmode. Fixes: #2519
* | Add CHANGES.current entry for Ocaml std::string changesOlly Betts2023-04-211-0/+3
| |