The macros for casting function pointers are now fully described and also
clarify why the macros act transparently for C even before Ruby 2.7.
In addition, an "if (CPlusPlus)" was removed in the code generator for
global variables in order to keep the distinction between C and C++ in
one place, which is at the definition of said macros.
This commit fixes the signatures of various callback methods
and cleans up the macro definitions used for casting callbacks.
Note that the transparent version of the macro RUBY_METHOD_FUNC
is currently masked behind RUBY_DEVEL, see commit
1d91feaf13
In order to still support strict signature checking and prevent
nasty deprecation warnings, the use of RUBY_METHOD_FUNC had to
be replaced with VALUEFUNC.
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
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.
- 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.
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()).
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.
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.
* 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.
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.
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
* 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.
* 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
* 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
* 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.