Commit graph

431 commits

Author SHA1 Message Date
William S Fulton
b655d3138b Remove the UnknownExceptionHandler director error handling class
Done in order to be C++17 compliant as it uses std::unexpected_handler
which was removed in C++17. This class was intended for director
exception handling but was never used by SWIG and was never documented.

Closes #1538
2019-06-27 07:40:49 +01:00
William S Fulton
5c1c69d140 Replace std::unexpected_handler with std::terminate_handler to be c++17 compliant
Closes #1538
2019-06-27 07:40:49 +01:00
William S Fulton
f3e2ab9195 Include all template parameters for std_unordered_multiset and std_unordered_set 2019-03-12 21:47:45 +00:00
William S Fulton
4a25ddbb97 Correct unordered_set/unordered_multiset template Key parameter name 2019-03-12 20:21:19 +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
William S Fulton
a006091b0f Add in a definition for RTYPEDDATA_P for Ruby<1.9.3
This definition ensures the SWIG wrappers keep compiling in older versions
of Ruby given the previous change (which uses RTYPEDDATA_P and hence
requires Ruby 1.9.3). The definition of RTYPEDDATA_P is such that the
previous commit plus the definition should keep the behaviour the same
as before.
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
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
d14c97408d Fix overloading for non-pointers and NULL - Ruby 2018-12-29 14:15:51 +00:00
William S Fulton
3915e7bd08 Remove final remnants of GCJ - jstring.i 2018-06-15 06:57:53 +01:00
luz.paz
6f69830321 follow-up typos 2018-05-17 10:26:00 -04:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
William S Fulton
c44adff7b9
Merge pull request #1177 from Sigill/sigabrt_rubyunlinkobject_fix
Do not abort when unlinking non-data ruby objects
2018-01-07 12:23:47 +00:00
William S Fulton
cd9b7c3c34 std_basic_string.i fixes
- Remove python code from octave's std_basic_string.i
- Correctly return an error to fix error handling when using std::basic_string in
  overloaded methods - issue #1171.
2018-01-04 07:00:26 +00:00
Cyrille Faucheux
a4884e45e1 Do not abort when unlinking non-data ruby objects
Fixes issue #1168.
Remove a call to abort() (introduced by commit
0e725b5d9b) made when SWIG_RubyUnlinkObjects()
is called on non T_DATA objects. It can happen when the destruction of T_DATA
objects is deferred: the Ruby GC first turn them to T_ZOMBIE, then calls their
free method (SWIG_RubyUnlinkObjects()).
2017-12-27 14:40:26 +01:00
William S Fulton
3f8b8fe734 Enhancements for directorin typemaps
The directorin typemaps will now generate a temporary variable
(specified after the type), such as:
%typemap(directorin) MyType (MyType *temp) { ... use temp ... }

The shared_ptr director typemaps have been fixed for use in functions
that take more than one parameter.
2017-10-16 19:28:27 +01:00
William S Fulton
6470fe8c36 Director shared_ptr typemaps for scripting languages
Modify the Python and Ruby director shared_ptr typemaps to be language neutral.
Port the director modifications to other scripting languages that
have shared_ptr support - Octave, R and Scilab. Scilab shared_ptr
support is not fully working and needs work though.
2017-10-13 07:34:38 +01:00
William S Fulton
d0615d98a9 Merge branch 'radarsat1-fix-null-shared_ptr-directors'
* radarsat1-fix-null-shared_ptr-directors:
  Remove duplicate director shared_ptr pointer reference typemaps
  For shared_ptr directorin, make copy of shared_ptr in all cases.
  Add directorin typemap for Python and Ruby shared_ptr.
2017-10-11 09:03:01 +01:00
William S Fulton
000e63e0f8 Remove duplicate director shared_ptr pointer reference typemaps 2017-10-11 07:08:46 +01:00
William S Fulton
e7f0c6d6ad Suppress Ruby std::wstring, std::string, std::basic_string warnings
Lib/std/std_basic_string.i:235: Warning 365: operator+= ignored
Lib/std/std_wstring.i:8: Warning 378: operator!= ignored

Correct 801 warning suppressions (which are normally suppressed in the test-suite):
Lib/std/std_wstring.i:13: Warning 801: Wrong class name (corrected to `Wstring')

Similarly for std::string when including basic_string.i class.
2017-10-10 07:52:10 +01: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
William S Fulton
e01cfd70c7 Add missing declaration for std::complex
Fixes missing type information for std::complex in scripting languages.
Closes #732.

Update Javascript and Octave complextest, although they don't actually
get run as they don't work
2017-10-02 19:07:24 +01:00
Stephen Sinclair
52ca39b5ab For shared_ptr directorin, make copy of shared_ptr in all cases. 2017-09-27 18:10:59 -03:00
Stephen Sinclair
bda750ee15 Add directorin typemap for Python and Ruby shared_ptr. 2017-09-27 11:22:30 -03:00
William S Fulton
eca67ee880 Ruby and Scilab shared_ptr typemap fragment correction
Remove some left over cruft from the python port
2017-09-25 08:45:31 +01:00
William S Fulton
ed4b84f4d3 Fix overloading of shared_ptr method overloading
Add 'equivalent' attribute to typecheck typemap.
Closes #1098.
2017-09-23 15:19:34 +01:00
Olly Betts
90f9117e10 Fix various comment and documentation typos 2017-08-13 18:04:33 +12:00
Mike Romberg
a67eff0ae9 remove bool from shared_ptr as well. 2017-07-03 20:55:40 -06:00
Mike Romberg
dd26e8a014 as() now always throws and never creates an invalid object with memset() 2017-07-03 15:35:24 -06:00
William S Fulton
e9e9531dc3 Merge branch 'tamuratak-fix_ruby_wstring'
* tamuratak-fix_ruby_wstring:
  [ruby] use %fragment to clarify the dependency of code.
  [ruby] should initialize static variables inside %init{}, in which it will not be        excuted concurrently by multiple threads.
  [ruby] * use static variable to avoid creating stirngs every time.        * fix possible overflow.
  [ruby] add std::wstring tests for string including a null terminator.
  [ruby] * rewrite SWIG_AsWCharPtrAndSize and SWIG_FromWCharPtrAndSize        * use UTF-32LE and UTF-16LE to avoid BOM        * add tests
  [ruby] use WCHAR_MAX to determine the encoding of std::wstring.
  [ruby] add a few tests for std::wstring
  [ruby] fix support for std::wstring.
2017-06-20 20:13:01 +01:00
William S Fulton
82969b0755 Fix warning in generated code - traits_asptr.
Visual Studio 2015 debug builds:
error C4703: potentially uninitialized local pointer variable 'p' used
2017-06-13 19:02:59 +01:00
William S Fulton
32855cfb69 Merge branch 'tamuratak-fix_ruby_unordered_set'
* tamuratak-fix_ruby_unordered_set:
  [ruby] add simple tests for std unordered containers.
  [ruby] clarify dependency of fragments for unordered_set containers.

 Conflicts:
	Examples/test-suite/ruby/Makefile.in
2017-04-24 20:44:12 +01:00
William S Fulton
ee44f9ba67 Merge branch 'tamuratak-fix_ruby_null_shared_ptr'
* tamuratak-fix_ruby_null_shared_ptr:
  [ruby] add a test.
  [ruby] use std::vector::back() method.
  [ruby] enable a test for null shared_ptr in containers.
  [ruby] add a test for null shared_ptr in containers.
  [ruby] treat null shared_ptr in std containers properly.

Conflicts:
	Examples/test-suite/ruby/Makefile.in
2017-04-24 19:50:59 +01:00
Takashi Tamura
43c3ca3767 [ruby] clarify dependency of fragments for unordered_set containers. 2017-04-22 16:35:25 +09:00
William S Fulton
71e5ff406f Merge branch 'tamuratak-fix_ruby_director_and_shared_ptr'
* tamuratak-fix_ruby_director_and_shared_ptr:
  Rename shared_ptr testcase
  [ruby] use boost/shared_ptr and boost_shared_ptr.i. not use auto.
  [ruby] delete unnecessary changes.
  [ruby] add %typemap(directorin) for shared_ptr.
  [ruby] enable a test, cpp11_shared_ptr_director.
  [ruby] add %typemap(directorin) and %typemap(directorout) for shared_ptr.
  [ruby] add %typemap(directorout) for shared_ptr.
  add a test for shared_ptr with director

Conflicts:
	CHANGES.current
2017-04-21 19:31:25 +01:00
Takashi Tamura
6672338cc0 [ruby] delete unnecessary changes. 2017-04-21 22:44:38 +09:00
William S Fulton
b4377488f7 Add assert for invalid NULL type parameter when calling SWIG_Ruby_NewPointerObj.
Closes #935
2017-04-20 18:51:45 +01:00
Takashi Tamura
0020fc97b0 [ruby] add %typemap(directorin) for shared_ptr. 2017-04-20 19:20:55 +09:00
Takashi Tamura
17b4e0c66e [ruby] add %typemap(directorin) and %typemap(directorout) for shared_ptr. 2017-04-20 19:20:11 +09:00
Takashi Tamura
b3c2b1c51c [ruby] add %typemap(directorout) for shared_ptr. 2017-04-20 19:20:11 +09:00
Takashi Tamura
661c3fc554 [ruby] treat null shared_ptr in std containers properly. 2017-04-20 18:53:47 +09:00
William S Fulton
c9d094e034 Merge branch 'tamuratak-shared_ptr_derived_2'
* tamuratak-shared_ptr_derived_2:
  Correct comment about const removal for shared_ptr
  Correct ordering of declarations in testcase
  Ruby shared_ptr on error code improvement in traits_as::as
  Add support for pointers to shared_ptr and null shared_ptr in Ruby containers
  Add shared_ptr non-overloaded upcast tests
  use forward declaration to treat the dependency of fragments
  [ruby] must not do a null check for VALUE.
  [ruby] add tests for shared_ptr of const Type.
  [ruby] For swig::from, use template specialization to convert shared_ptr<const T> to shared_ptr<T>.
  [ruby] edit comments [skip ci]
  [ruby] move template specialization to std_shared_ptr.i.
  [ruby] add tests for upcasting std::shared_ptr within std containers.
  [ruby] use template specialization for swig::asptr,asval functions on std:shared_ptr.
2017-04-20 07:50:20 +01:00
William S Fulton
660147043d Correct comment about const removal for shared_ptr 2017-04-20 07:49:03 +01:00
William S Fulton
1a6f8d1e4b Ruby shared_ptr on error code improvement in traits_as::as 2017-04-13 07:04:07 +01:00
William S Fulton
83a389d3fb Add support for pointers to shared_ptr and null shared_ptr in Ruby containers
Upcasting of pointers to shared_ptr would need some more fundamental
changes, but not done yet ... pointers to shared_ptr are not common.
2017-04-13 06:59:56 +01:00
Takashi Tamura
b32854bc59 use forward declaration to treat the dependency of fragments 2017-03-29 19:11:44 +09:00
Takashi Tamura
377d439964 Merge remote-tracking branch 'origin/shared_ptr_const_conv' into shared_ptr_derived_2 2017-03-29 18:16:01 +09:00
William S Fulton
382b3f0f8c Merge branch 'tamuratak-fix_typo_ruby_unordered_map'
* tamuratak-fix_typo_ruby_unordered_map:
  [ruby] add a test to make sure that std::multiset is including Enumerable.
  [ruyb] enable std::list test for Ruby.
  [ruby] make std::list include Enumerable.
  [ruby] make std::multiset and std::unordered_multiset include Enumerable. tests added.
  [ruby] make std::unordered_map include Enumerable.
2017-03-29 08:56:25 +01:00
Takashi Tamura
cb1f89cb68 [ruby] must not do a null check for VALUE. 2017-03-07 11:43:01 +09:00