Commit graph

275 commits

Author SHA1 Message Date
Bernhard Rosenkränzer
8ece583aa0 Fix push/pop mismatch
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`.
2022-11-29 00:55:07 +01:00
William S Fulton
e97181ebc0 Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr
To fix overloading when using these types.
2022-09-17 10:23:51 +01:00
William S Fulton
dad7c93ca0 Provide SWIGTYPE MOVE typemaps in swigmove.i
For implementing full move semantics when passing parameters by value.
Based on SWIGTYPE && and std::unique_ptr typemaps which implement move
semantics.

Added for all languages, but untested for: Go, Ocaml, R, Scilab (and
unlikely to be fully functional for same reasons as for std::unique_ptr
support).

Issue #999
2022-09-16 08:36:25 +01:00
William S Fulton
89f57708e9 Suppress -Wvolatile gcc warnings in Perl headers for C++20
Seen in Perl 5.34 and earlier
2022-07-31 16:45:31 +01:00
William S Fulton
db5e37a1d7 Add support for std::auto_ptr inputs
Ported from std::unique, behaviour is identical with regard to memory ownership/handling
2022-07-18 08:32:26 +01:00
William S Fulton
5dd5e80a84 Cosmetic formatting and doc updates in std_unique_ptr.i files 2022-07-17 20:44:20 +01:00
William S Fulton
50fc600e8c Add Perl support for std::unique_ptr inputs
Equivalent to Java/C#/Python/Ruby implementations.
2022-07-17 20:23:52 +01:00
William S Fulton
2bba78f757 Add std::auto_ptr support for Perl based on std::unique_ptr 2022-07-12 09:41:56 +01:00
Erez Geva
adb85d3d05 Add std::unique_ptr<type> to Perl5.
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2022-07-09 13:52:43 +02:00
William S Fulton
e4cdf9d98f argcargv.i cosmetic updates 2022-05-15 18:32:53 +01:00
William S Fulton
0307d0732c Typemaps for (int ARGC, char **ARGV) fixup
The default typemap should not be in this library file - this is for
users to add in if they want C default argument support.
2022-05-15 18:21:59 +01:00
Erez Geva
b88fe498ca Fix argcargv.i in Perl5, Tcl, PHP
Add missing type map for type check.
Add testing of argcargv.i for Perl5, Tcl, PHP and Ruby.

Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2022-05-11 01:10:12 +02:00
Erez Geva
464d548d71 Add argcargv.i to more languages: Perl 5, Tcl, PHP
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2022-05-06 23:15:06 +02:00
Olly Betts
b2c58115d7 Fix previous commit
Revert changes inadvertently included, and fix `=` to `==`.
2022-03-20 19:44:23 +13:00
Olly Betts
029ddab8b5 [ci] Try to fix failing appveyor python builds 2022-03-20 18:42:50 +13:00
Olly Betts
748a9a5452 [perl] Require at least Perl 5.8.0
As discussed and agreed in #1629, it's become hard to test with Perl
5.6 or earlier, such old versions are no longer in active use, and
4.1.0 is an appropriate time to make such a change.

I've dropped the compatibility code that was obvious to me, but there's
probably more that can be cleaned up now.
2022-01-19 10:07:30 +13:00
Anthony Heading
6c59cae799 Avoid gcc 11 misleading indentation warning in generated code
Closes https://github.com/swig/swig/pull/2074
2021-10-03 17:18:58 +02:00
William S Fulton
13158bda9a Member function pointer typemap tweaks
Use sizeof variable name rather than variable type.
Workaround Visual C++ unable to parse some complex C++11 types, such as
  sizeof(short (Funcs::*)(bool) const &&)
2021-04-26 22:32:52 +01:00
William S Fulton
52063a732b Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
William S Fulton
6d27ead9c0 Add STL container copy constructors where missing
Also provide consistent copy constructor declarations.
2019-02-14 18:53:05 +00:00
William S Fulton
440264e479 Add missing typedefs to std::list + typedef corrections
Numerous missing typedefs added.
std::list<T*>::const_reference and std::list<T*>::reference
specialization typedef fixes.
2019-02-14 07:31:21 +00:00
William S Fulton
e26f6bb4e2 Add missing typedefs to std::vector + typedef corrections
Tests for std::vector of pointers added which check
 std::vector<T*>::const_reference and std::vector<T*>::reference
usage which gave compilation errors in Python and Perl which had
specialized these vectors incorrectly.
2019-02-13 22:46:28 +00:00
William S Fulton
a47c2553f5 Add missing typedefs to std::pair 2019-02-13 22:46:28 +00:00
William S Fulton
9dd33e6367 Add missing typedefs to std::map 2019-02-13 22:46:27 +00:00
William S Fulton
6d0c495fd0 Add missing parameter names in STL container wrappers
Mostly in STL copy constructors.

Best to have parameter names as they make their way into the wrappers in
some target languages.
2019-02-13 22:45:47 +00:00
William S Fulton
68e86614ff Create a consistent stl.i library file
Same file now for all languages except R which is still missing std_map.i.
Recent Java changes adding in std_set.i removed.
2019-02-12 18:46:05 +00:00
William S Fulton
b1178cf130 Fix overloading for non-pointers and NULL - Perl 2018-12-29 14:15:59 +00:00
Robert Stone
871ece78e6 repair uses of EXTEND() in Perl typemaps
closes #1374
 * enhance testing around multiple return values
   Examples/test-suite/perl5/scilab_multivalue_runme.pl fails in
   perl-5.28.1 compiled with -DDEBUGING without the typemap updates
 * repair EXTEND() handling in typemaps
 * Use PL_sv_undef for VOID_Object
2018-12-11 15:51:14 -08:00
William S Fulton
ca287ae13b Add support for non-default compare template argument in std::map wrappers 2018-10-09 19:44:00 +01:00
William S Fulton
3915e7bd08 Remove final remnants of GCJ - jstring.i 2018-06-15 06:57:53 +01:00
William S Fulton
717b7866d4 Perl - Add support for missing directorfree typemaps
Related to issue #1167, to free up memory when returning reference types.
SWIG_Perl_AcquirePtr still needs implementing.
2017-12-14 07:51:45 +00:00
William S Fulton
923091da13 Changes to use common DirectorException class
Add director.swg for Go as was completely absent.
This is just the start of a common exception handling approach to directors.
An exception thrown in a Java director method will be propogated back to
Java via a C++ DirectorException.
DirectorException throws typemap for Java is fully working, all other languages need work.
DirectorException throws typemap for Perl added just to fix compilation errors.
Add director_exception_catches test.
2017-11-29 20:31:55 +00:00
Olly Betts
5a9422d980 Remove GCJ support
GCC7 dropped GCJ.

Closes https://sourceforge.net/p/swig/bugs/823/
2017-10-09 08:32:01 +13:00
Olly Betts
90f9117e10 Fix various comment and documentation typos 2017-08-13 18:04:33 +12:00
William S Fulton
d9db3cf628 Add some missing SWIGINTERN usage 2017-01-17 20:08:46 +00:00
William S Fulton
db54a8d5d1 Fix unused warnings in perl wrappers 2016-05-28 09:59:16 +01:00
William S Fulton
7ead141aa9 Fix unused variable warning in Perl wrappers 2016-05-28 00:45:24 +01:00
Alec Cooper
4e2fc7d115 Don't use long long if it isn't available
Adds preprocessor checks to avoid defining functions that use long long if it isn't available
Effects the following languages: javascript, octave, perl, python, r, ruby, tcl
2016-01-06 16:52:37 -05:00
William S Fulton
6b4e57245d Fix STL wrappers to not generate <: digraphs.
For example std::vector<::X::Y> was sometimes generated, now
corrected to std::vector< ::X::Y >.
2015-12-12 14:05:46 +00:00
Robert Stone
9d19640141 check ranges in perlprimtype.swg more carefully to avoid clang warnings 2015-08-08 11:39:19 -07:00
Olly Betts
d1a8675ac4 Fix incorrect comments 2015-05-09 21:59:03 +12:00
Olly Betts
083a03710a Remove no-op calls to swig_incref().
Python and Perl were calling this from the Director constructor, but
swig_disown_flag is always false at that point, so the call doesn't
do anything.
2015-05-09 18:34:11 +12:00
Olly Betts
0fad8a3728 '#undef seed' macro which Perl API headers define
This macro breaks '#include <algorithm>', causing generated Perl
bindings to fail to compile with 'g++ -std=gnu++11'.
2015-05-02 00:06:58 +12:00
Robert Stone
03570f85f2 [Perl] tidy "warning: duplicate 'extern' declaration specifier" when building generated code under clang 2014-12-27 20:45:11 -08:00
Karl Wette
d5b765d388 Whitespace cleanup of all Makefiles*
- some of the %.clean rules in the test-suite Makefiles were using a single tab
  as an empty rule, dangerous! I've replaced these with the safer '@exit 0'.
2014-05-02 20:06:11 +02:00
Olly Betts
2f3bf144c6 Fix assorted comment and documentation typos 2014-02-23 17:15:22 +13:00
William S Fulton
ae7b34ce03 Remove duplicate header includes in director.swg 2014-02-21 19:07:35 +00:00
William S Fulton
0d9a8721f4 Move some header file includes into fragments for UTL languages 2014-02-21 19:02:14 +00:00
William S Fulton
bd5c340062 Add <string> fragment
Removes <string> include specifically for clang
Cuts down on duplicate #include <string> in general
2014-02-15 23:30:14 +00:00
William S Fulton
cc650e692e Director exceptions now derive from std::exception 2014-01-20 19:40:52 +00:00