summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* [tcl] Add string_view supportOlly Betts2023-05-172-0/+18
| | | | See #1567
* [java] Suppress removal warnings for finalize()Olly Betts2023-05-121-1/+1
| | | | | | | | | The "deprecation" warning has been changed to a "removal" warning with newer JDK versions. This needs to be addressed, but meanwhile it makes running the testsuite unusably noisy so suppressing it seems more helpful than not. Closes: #2556
* Initial support for std::string_viewOlly Betts2023-05-085-0/+366
| | | | | | | So far C#, Java, Lua and PHP are supported. Closes: #2540 See #1567
* [D] Update docs for D1 removalOlly Betts2023-05-042-2/+2
|
* Drop D version 1Erez Geva2023-05-046-422/+0
| | | | See #2538
* Fix typo: "temporal" which should be "temporary"Olly Betts2023-04-272-2/+2
|
* Allow using snprintf() instead of sprintf() in wrappersOlly Betts2023-04-2721-44/+68
| | | | | | | | | | | | | | | | | | | 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-2615-482/+90
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-263-118/+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-263-66/+61
| |
| * 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
* | [php] Add throws typemaps for string* + const string*Olly Betts2023-04-241-0/+5
| |
* | 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).
* | [php] Support INPUT,INOUT,OUTPUT for std::string&Olly Betts2023-04-211-9/+37
| | | | | | | | | | | | | | 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.
* | Fix CanCastAsInteger if errno is set.Markus Wick2023-04-211-3/+5
| | | | | | | | | | | | | | | | | | | | 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
* | [OCaml] Fix reference typemaps for std::stringZackery Spytz2023-04-211-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings in the extend_template_method, li_std_string, and template_methods tests. std::string was missing a typecheck typemap. Add extend_template_method_runme.ml, li_std_string_runme.ml, and template_methods_runme.ml. Add INPUT, OUTPUT and INOUT typemaps for string & Use the INOUT typemap in the strings_test example. In the strings_test example, takes_and_gives_std_string() was relying on the silly fact that an argout typemap for string & was enabled by default. Remove the in, out, and typecheck typemaps for string &. Closes: #1439
* | Remove remaining traces of PHP7 supportOlly Betts2023-04-202-10/+3
| | | | | | | | | | The bulk of this was already removed in e3b112c69ceed5c39cb07fa45a3ba62b27712679.
* | [php] Remove unused exception.i includeOlly Betts2023-04-201-2/+0
| |
* | Make string& consistent in PHP's std_string.iOlly Betts2023-04-201-6/+6
| |
* | Merge branch 'go-argcargv'Olly Betts2023-04-201-0/+64
|\ \
| * | Add argc and argv multi-argument to go.Erez Geva2023-04-191-0/+64
| | | | | | | | | | | | | | | | | | Make argc and argv test works in C. Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
* | | scilab: detect version 2023 correctlyClément DAVID2023-04-201-17/+16
| | |
* | | Merge branch 'fix-undefining-allocator'Olly Betts2023-04-191-1/+1
|\ \ \
| * | | Really fix "mixed declarations and code" warningOlly Betts2023-04-191-3/+1
| | | |
| * | | Fix "ISO C90 forbids mixed declarations and code" warningMaple Ong2023-04-121-1/+2
| | | |
| * | | Fix "undefining the allocator of T_DATA" error seen in Ruby 3.2Maple Ong2023-04-121-1/+2
| | |/ | |/| | | | | | | | | | Ruby 3.2 issue: https://bugs.ruby-lang.org/issues/18007 Similar to https://github.com/robinst/swig/commit/9b5d37fd174331fa2b7113fe968fcf0570de43bf
* | | [scilab] Extract values with ":"Clément DAVID2023-04-194-5/+38
| |/ |/| | | | | Fixes #894
* | Remove support for PHP7Olly Betts2023-04-142-66/+3
|/ | | | | 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.
* Merge branch 'alatina-master'William S Fulton2023-03-252-2/+9
|\ | | | | | | | | | | | | * alatina-master: Update octruntime.swg Update octrun.swg to work with Octave v8.1.0 Update octruntime.swg to work with Octave v8.1.0
| * Update octruntime.swgAndrea L2023-03-141-2/+3
| |
| * Merge pull request #2 from alatina/alatina-patch-octave-8.1.0Andrea L2023-03-141-1/+3
| |\ | | | | | | Update octruntime.swg to work with Octave v8.1.0
| | * Update octruntime.swg to work with Octave v8.1.0Andrea L2023-03-141-1/+3
| | |
| * | Update octrun.swg to work with Octave v8.1.0Andrea L2023-03-141-1/+5
| |/
* | Merge branch 'bda_resolve_warnings'William S Fulton2023-03-242-1/+4
|\ \ | | | | | | | | | | | | | | | * bda_resolve_warnings: Use $self instead of self Lib/csharp: Resolve a few warnings about unused parameters
| * | Use $self instead of selfWilliam S Fulton2023-03-242-4/+4
| | |
| * | Lib/csharp: Resolve a few warnings about unused parametersMario Emmenlauer2023-01-102-1/+4
| |/
* | Merge pull request #2499 from MyroslavaStopets/nullptr-utilizationWilliam S Fulton2023-03-242-22/+28
|\ \ | | | | | | [Java] Added usage of nullptr instead of NULL
| * | Added usage of nullptr instead of NULLMyroslava Stopets2023-02-082-22/+28
| |/
* | std_array.i std_vector.i tweaksWilliam S Fulton2023-03-222-19/+9
| | | | | | | | | | | | | | Efficiency fixes and tidy up from previous commit. Add test case for constructing from differently sized containers. Issue #2478
* | Lib/csharp: Better standardized std_vector.i and std_array.iMario Emmenlauer2023-01-102-29/+68
|/
* Merge pull request #2460 from swig-fortran/remove-python-sprintfWilliam S Fulton2022-12-301-3/+3
|\ | | | | [Python] Eliminate sprintf in generated code
| * Eliminate sprintf in generated python codeSeth R Johnson2022-12-061-3/+3
| | | | | | | | | | | | | | Newer clang versions emit warnings in generated code: ``` warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] ```
* | Lua variadic templates sizeof... constants fixWilliam S Fulton2022-12-221-2/+2
|/
* Fix push/pop mismatchBernhard Rosenkränzer2022-11-291-0/+3
| | | | | | | | | Without this, perlhead.swg does `#pragma GCC diagnostic pop` if `__GNUC__ >= 10` - without any prior `#pragma GCC diagnostic push`. There's also a mismatch between the conditions that trigger `#pragma GCC diagnostic ignored` (where the `push` should be) and the attempt to `#pragma GCC diagnostic pop`.