Commit graph

5,102 commits

Author SHA1 Message Date
William S Fulton
51e75bacf7 Merge branch 'csharp-set'
* csharp-set:
  Fix header comment in C# std_set typemaps
  Implement set-theoretic methods in std::set C# typemaps
  Add std::set<> typemaps for C#
2019-03-12 22:30:15 +00:00
William S Fulton
404aa2c3db Merge branch 'std_unordered_map_args_fix'
* std_unordered_map_args_fix:
  Include all template parameters for std_unordered_multimap and std_unordered_map
  Include all template parameters for std_unordered_map macro
2019-03-12 20:03:48 +00:00
William S Fulton
30f59ffe22 Include all template parameters for std_unordered_multimap and std_unordered_map 2019-03-12 20:03:14 +00:00
Vadim Zeitlin
aaa12450c0 Implement set-theoretic methods in std::set C# typemaps
These implementations are not optimized, i.e. are done in a naive way in
C#, rather than using C++ functions more efficiently, but are better
than nothing.
2019-03-11 23:05:38 +01:00
Vadim Zeitlin
f0067b6bbf Add std::set<> typemaps for C#
Create new Lib/csharp/std_set.i based on the existing std_map.i and run
li_std_set unit test for C# as well.

Notice that the set operations defined by the base ISet<> interface are
not implemented yet.
2019-03-11 22:49:03 +01:00
William S Fulton
b1f68b893b Merge branch 'MSVC-compiler-warnings'
* MSVC-compiler-warnings:
  Fix some MSVC compiler warnings in the test suite
2019-03-11 19:06:16 +00:00
Zackery Spytz
a0b84f5180 Fix some MSVC compiler warnings in the test suite
nested_in_template_wrap.cxx(247): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
python_pybuffer_wrap.cxx(2788): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
Modules\python.cxx(2227) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
2019-03-07 09:44:01 -07:00
William S Fulton
412b113c0b Run errors test cases in predictable order 2019-03-03 16:00:02 +00:00
William S Fulton
bc0645ce2b Merge branch 'ZackerySpytz-director-classes-final-methods'
* ZackerySpytz-director-classes-final-methods:
  Warning tweaks for destructors that are final in director classes
  Documentation for directors and virtual final methods
  Fixes for final destructors in director classes
  Warning fix for final destructor in directors
  Remove a useless warning filter
  Fix the handling of director classes with final methods
2019-03-03 15:12:53 +00:00
William S Fulton
39b44a377a Warning tweaks for destructors that are final in director classes 2019-03-03 15:12:29 +00:00
William S Fulton
3b07cba740 Fixes for final destructors in director classes
A class marked as a director with a final destructor should not be a
wrapped as a director class. Fix seg faults in this case.
2019-03-03 14:52:52 +00:00
William S Fulton
b9c4a84780 Warning fix for final destructor in directors
Fix suppression of final destructors used in director classes.
Add testcase for final destructors in director classes.
2019-03-02 19:02:35 +00:00
William S Fulton
195226873e Merge branch 'ZackerySpytz-valid-floating-point-literals'
* ZackerySpytz-valid-floating-point-literals:
  Fix some rejections of valid floating-point literals
2019-03-02 17:48:49 +00:00
William S Fulton
be491506a4 Java std::vector improvements for types that do not have a default constructor.
The std::vector wrappers have been changed to work by default for elements that are
not default insertable, i.e. have no default constructor. This has been achieved by
not wrapping:

  vector(size_type n);

Previously the above had to be ignored via %ignore.

If the above constructor is still required it can be added back in again via %extend:

  %extend std::vector {
    vector(size_type count) { return new std::vector< T >(count); }
  }

Alternatively, the following wrapped constructor could be used as it provides near-enough
equivalent functionality:

  vector(jint count, const value_type& value);

The equivalent change to std::list has also been made (std::list
wrappers were not in the previous release [3.0.12] though).
2019-03-01 18:01:14 +00:00
William S Fulton
9e29ae16d2 Update template_opaque testcase 2019-03-01 08:15:03 +00:00
William S Fulton
83ea2280e2 Fix Python compile errors with overloading and varargs
Fixes wrapping overloaded functions/constructors where a vararg
function is declared after a non-vararg function.
This is a long standing bug in the Python layer exposed since fastunpack
was turned on by default.
2019-02-25 19:27:23 +00:00
Zackery Spytz
cbae09f92f Merge remote-tracking branch 'upstream/master' into director-classes-final-methods 2019-02-24 08:08:52 -07:00
Zackery Spytz
e8cc5929de Remove a useless warning filter
Add cpp11_final_directors to Examples/test-suite/common.mk.
2019-02-24 08:04:45 -07:00
Takashi Tamura
72723d354a minor edit 2019-02-22 19:55:55 +00:00
Takashi Tamura
ff9e9f9f98 [ruby] check whether object is of RTypedData using RTYPEDDATA_P. 2019-02-22 19:55:54 +00:00
Zackery Spytz
c3d652c785 Fix the handling of director classes with final methods
Generated SwigDirector_* classes were attempting to override
methods marked as final.

In addition, give a warning if the destructor of a director class is
final.

Closes #564.
2019-02-22 06:28:53 -07:00
William S Fulton
e6035d625a Java 9 deprecation warning fixes for test-suite and examples 2019-02-21 13:47:39 -08:00
William S Fulton
6d8c1c47f3 Merge branch 'java9_finalize_warnings'
* java9_finalize_warnings:
  [Java] Suppress deprecation warning on finalize method
2019-02-21 13:46:59 -08:00
Zackery Spytz
1c03af9b96 Fix some rejections of valid floating-point literals
Some valid floating-point literals were giving
"Error: Syntax error in input(1)".
2019-02-21 02:11:51 -07:00
William S Fulton
1f46d9b7b9 Fix regression parsing gcc preprocessor linemarkers
These are preprocessor statement in the form:

 # linenum filename flags

Closes #1475
2019-02-19 21:32:04 +00:00
William S Fulton
9038a9987d Add std::vector back reference test 2019-02-18 21:39:17 +00:00
William S Fulton
f19882ed51
Merge pull request #1473 from ZackerySpytz/OCaml-wrapmacro-test
[OCaml] Fix the wrapmacro test
2019-02-18 19:33:22 +00:00
William S Fulton
911bc5310f
Merge pull request #1472 from ZackerySpytz/OCaml-SWIGTYPE-typecheck
[OCaml] Add a typecheck typemap for SWIGTYPE
2019-02-18 19:31:50 +00:00
William S Fulton
b9350614b5 Fix typemap matching to expand template parameters when the name contains template parameters.
In the %typemap below the type is T and the name is X<T>::make
which now expands correctly to X< int >::make

template<typename T> struct X {
  %typemap(out) T X<T>::make "..."
  T make();
};

%template(Xint) X<int>;
2019-02-17 21:38:48 +00:00
William S Fulton
629c881de5 Template instantion fixes when template parameter is used twice in type
For example T in:
Y<T>::YYY<T>::value_type
2019-02-17 20:03:18 +00:00
Zackery Spytz
10d62aecd5 [OCaml] Fix the wrapmacro test
Add a typecheck typemap for size_t and const size_t &.

Add the const qualifier to the typemaps for primitive reference
types.

Add multiple runtime tests.
2019-02-17 01:41:59 -07:00
William S Fulton
eb7b989c61 Fix parser error containing multiple #define statements inside an enum.
The second #define fails to parse:

  enum FooEnum {
    ENUM1 = 0,
    ENUM2 = 1,

  #define MACRO_DEF1 "Hello"
  #define MACRO_DEF2 "World!"

    ENUM3 = 2,
    ENUM4 = 3,
  };

Bug mentioned at https://sourceforge.net/p/swig/patches/333/
2019-02-16 08:09:56 +00:00
Zackery Spytz
b7a400f991 [OCaml] Add a typecheck typemap for SWIGTYPE
This fixes many of the remaining warnings in the OCaml test suite.

Add multiple runtime tests.
2019-02-16 01:07:31 -07:00
William S Fulton
6522afe90a
Merge pull request #1471 from ZackerySpytz/OCaml-segfaults-list-args
[OCaml] Fix segfaults when too few arguments are passed to a function
2019-02-15 19:14:45 +00:00
William S Fulton
1f4b3a4553
Merge pull request #1470 from ZackerySpytz/OCaml-dynamic_cast-test
[OCaml] Fix the dynamic_cast test
2019-02-15 19:10:15 +00:00
William S Fulton
dd8c3e1466
Merge pull request #1461 from ZackerySpytz/OCaml-argout-typemaps-ref-types
[OCaml] Don't use argout typemaps by default for some reference types
2019-02-15 19:06:05 +00:00
William S Fulton
b0f105fa9f
Merge branch 'master' into cpp17-hexadecimal-floating-literals 2019-02-15 18:57:25 +00:00
Zackery Spytz
071803f000 [OCaml] Fix segfaults when too few arguments are passed to a function
Prevent segfaults when too few arguments are passed to a function.

Length checks are not needed for the wrappers of overloaded
functions -- the generated dispatch function already checks.

Add default_args_runme.ml.

Fix minor errors in some runtime tests.  Extra args were being passed
in some cases.
2019-02-15 01:17:15 -07:00
Zackery Spytz
a159a252dd [OCaml] Fix the dynamic_cast test
Add out typemaps for SWIGTYPE *DYNAMIC and SWIGTYPE &DYNAMIC.

Add dynamic_cast_runme.ml.
2019-02-14 02:21:36 -07: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
1f44997343 rename std::array testcase 2019-02-13 22:46:20 +00:00
Zackery Spytz
cf83adfcd1 Add support for C++17 hexadecimal floating literals 2019-02-13 15:16:40 -07:00
William S Fulton
8c207dd3a9 Merge branch 'master' of git+ssh://github.com/swig/swig
* 'master' of git+ssh://github.com/swig/swig:
  [Python] Fix some errors in the documentation for -threads
  Fixed typo in Perl5 docs.
  Update PHP testsuite for vadz's new cars
  [php] Whitespace improvements in generated C/C++ code
  Fix hardcoded _v in PHP typecheck typemaps
2019-02-12 18:53:46 +00:00
William S Fulton
136e6cfe2b Merge branch 'bkotzz-add_set_map'
* bkotzz-add_set_map:
  Add missing typedefs to Java STL containers
  Combine duplicate unordered_set unordered_map testcases
  Nicer looking generated Java container code
  Replicate some cosmetic changes from std_map.i
  Legacy macros, protected iterator, typedefs
  Remove c++11 from stl.i
  Add to STL file as well
  Maps both working as java.util impls
  Mostly working for map
  Add set/unordered_set that extend AbstractSet
  Move unordered containers under cpp11_ prefix
  Add test cases to C++11 list
  Add unordered_{set|map} and set to Java
2019-02-12 18:09:38 +00:00
William S Fulton
82d1632071 Combine duplicate unordered_set unordered_map testcases
Merge cpp11_li_std_unordered_map into cpp11_std_unordered_map
Merge cpp11_li_std_unordered_set into cpp11_std_unordered_set
2019-02-12 06:48:13 +00:00
Olly Betts
9db02a1e6b Update PHP testsuite for vadz's new cars 2019-02-12 10:27:31 +13:00
William S Fulton
be84fc62a9 Merge branch 'ZackerySpytz-cpp14-binary-integer-literals'
* ZackerySpytz-cpp14-binary-integer-literals:
  Add support for C++14 binary integer literals
2019-02-11 18:36:47 +00:00
William S Fulton
ad7f9cd8d7 Mark and setup OCaml as an experimental target language.
Issue #1437
2019-02-11 18:30:35 +00:00
Vadim Zeitlin
ddf4bbe112 Merge branch 'fix-ignore-param'
Fix for wrongly renaming parameters to "$ignore" in Python.

See https://github.com/swig/swig/pull/1462
2019-02-11 14:24:46 +01:00
Zackery Spytz
23d83cd9c1 Add support for C++14 binary integer literals
Closes #1030.
2019-02-10 15:38:49 -07:00