diff options
author | Ian Lance Taylor <iant@google.com> | 2011-01-11 18:47:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2011-01-11 18:47:40 +0000 |
commit | 6ce1f70de8c52ea765aba9688b16da890946e601 (patch) | |
tree | bd9e2e22a7a2bbf4158cdd96fa515e88c27ac814 | |
parent | 18a4f389f92b4ea64e0d3c2f7172938384e06de2 (diff) | |
download | swig-6ce1f70de8c52ea765aba9688b16da890946e601.tar.gz |
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
-rw-r--r-- | Examples/test-suite/exception_order.i | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Examples/test-suite/exception_order.i b/Examples/test-suite/exception_order.i index 45a87e0c5..4dd13858a 100644 --- a/Examples/test-suite/exception_order.i +++ b/Examples/test-suite/exception_order.i @@ -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 { |