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:
Ian Lance Taylor 2011-01-11 18:47:40 +00:00
commit 6ce1f70de8

View file

@ -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 {