The director c++ exceptions are thrown in a helper method instead of in
the director overloaded method. This circumvents compiler warnings about
throwing exceptions when the method has an exception specification or
noexcept. If the exception is thrown, abort will still be called!
In Java, the "director:noexcept" typemap can be used to do something
else. This typemap should be ported to the other languages too.
1) The %extend directive can now optionally support one of the 'class', 'struct' or 'union'.
2) The SWIG library no longer uses the javatype, dtype or cstype typemaps, thereby
completely freeing them up for users to use without having to replicate the library
code that they previously added
Tested by changes to test: java_lib_arrays
The original code was ported from the C# module. It looks like it
tried to avoid reading TLS data by using a shared counter. However,
without also synchronizing on the counter check (or using atomics)
the code is racy. While the races might be benign (the thread that
sets the exception also increments the counter, so when there is
actually an exception, the visible value will always be non-zero
even if it is outdated), they are still undefined behavior,
strictly speaking. Additionally, just using TLS isn't expensive
either.
There might be other cases where this happens when $dclassname
is used for code emitted into the proxy class itself, but so
far, there are none in the test suite or any bug reports.
clang++ using -stdlib=libc++ defines const_reference as a class,
to map boolean vectors onto a bit set. Because swig does
not "see" the type as "const &" it generates incorrect code for this case,
generating a declaration like:
const_reference result;
When const_reference is a typedef to 'bool' as is the case with stdlibc++
this works. When this is actually a constant reference, this is clearly
invalid since it is not initialized. For libc++, this is a class
which cannot be default constructed, resulting in an error. The fix
is to explicitly define the various accessor extensions as having a
bool return type for this specialization.
Previously, C's long/ulong types would always be mapped to 32 bit integers in D, which is wrong on D_LP64, but was not really a problem in practice since DMD used to be 32 bit only.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12861 626c5289-ae23-0410-ae9c-e8d60b6d4f22
I am not sure why these typemaps were missing before since I included code for this in the C++ part of the feature, but please let me know if I missed some case where this could break generated code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12406 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This was suggested by wsfulton on the mailing list in order to bring the D module in line with the C# one, the naming scheme of which is intended to be language-independent.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12319 626c5289-ae23-0410-ae9c-e8d60b6d4f22
A C++ class called "Exception" could shadow the built-in one before, leading to compilation errors in the exception handling code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12318 626c5289-ae23-0410-ae9c-e8d60b6d4f22