Fix to work with Go when using the gccgo compiler.
The gccgo compiler permits a Go exception to be caught in C++ and vice-versa. Add a rethrow to avoid this case. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12390 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
18a4f389f9
commit
6ce1f70de8
1 changed files with 20 additions and 0 deletions
|
|
@ -2,6 +2,14 @@
|
|||
|
||||
%warnfilter(SWIGWARN_RUBY_WRONG_NAME);
|
||||
|
||||
#if defined(SWIGGO) && defined(SWIGGO_GCCGO)
|
||||
%{
|
||||
#ifdef __GNUC__
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
%}
|
||||
#endif
|
||||
|
||||
%include "exception.i"
|
||||
|
||||
%{
|
||||
|
|
@ -23,6 +31,18 @@
|
|||
SWIG_exception_fail(SWIG_RuntimeError,"postcatch unknown");
|
||||
}
|
||||
}
|
||||
#elif defined(SWIGGO) && defined(SWIGGO_GCCGO)
|
||||
%exception %{
|
||||
try {
|
||||
$action
|
||||
#ifdef __GNUC__
|
||||
} catch (__cxxabiv1::__foreign_exception&) {
|
||||
throw;
|
||||
#endif
|
||||
} catch(...) {
|
||||
SWIG_exception(SWIG_RuntimeError,"postcatch unknown");
|
||||
}
|
||||
%}
|
||||
#else
|
||||
%exception {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue