From ce1cb85d86eac2ad7f8704d056b5bb24cf7bff55 Mon Sep 17 00:00:00 2001 From: Daniel Vollmer Date: Sat, 17 Sep 2016 13:24:32 +0200 Subject: [PATCH] Add header for std::bad_cast --- Lib/csharp/std_except.i | 1 + Lib/d/std_except.i | 1 + Lib/exception.i | 3 +++ Lib/go/std_except.i | 1 + Lib/java/std_except.i | 1 + Lib/lua/std_except.i | 1 + Lib/std/std_except.i | 1 + Lib/std_except.i | 1 + 8 files changed, 10 insertions(+) diff --git a/Lib/csharp/std_except.i b/Lib/csharp/std_except.i index 1f6b2c483..c983bd0f6 100644 --- a/Lib/csharp/std_except.i +++ b/Lib/csharp/std_except.i @@ -7,6 +7,7 @@ * ----------------------------------------------------------------------------- */ %{ +#include #include %} diff --git a/Lib/d/std_except.i b/Lib/d/std_except.i index 4a0ce6d69..fbfd6c337 100644 --- a/Lib/d/std_except.i +++ b/Lib/d/std_except.i @@ -7,6 +7,7 @@ * ----------------------------------------------------------------------------- */ %{ +#include #include %} diff --git a/Lib/exception.i b/Lib/exception.i index c2c9c47ef..c8509987b 100644 --- a/Lib/exception.i +++ b/Lib/exception.i @@ -258,6 +258,7 @@ SWIGINTERN void SWIG_DThrowException(int code, const char *msg) { } */ %{ +#include #include %} %define SWIG_CATCH_STDEXCEPT @@ -274,6 +275,8 @@ SWIGINTERN void SWIG_DThrowException(int code, const char *msg) { SWIG_exception(SWIG_IndexError, e.what() ); } catch (std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what() ); + } catch (std::bad_cast& e) { + SWIG_exception(SWIG_TypeError, e.what() ); } catch (std::exception& e) { SWIG_exception(SWIG_SystemError, e.what() ); } diff --git a/Lib/go/std_except.i b/Lib/go/std_except.i index 9439120e6..4f021a126 100644 --- a/Lib/go/std_except.i +++ b/Lib/go/std_except.i @@ -7,6 +7,7 @@ * ----------------------------------------------------------------------------- */ %{ +#include #include %} diff --git a/Lib/java/std_except.i b/Lib/java/std_except.i index b89ee617f..91d2f92cf 100644 --- a/Lib/java/std_except.i +++ b/Lib/java/std_except.i @@ -7,6 +7,7 @@ * ----------------------------------------------------------------------------- */ %{ +#include #include %} diff --git a/Lib/lua/std_except.i b/Lib/lua/std_except.i index fd63663af..34ab6a1ad 100644 --- a/Lib/lua/std_except.i +++ b/Lib/lua/std_except.i @@ -8,6 +8,7 @@ * ----------------------------------------------------------------------------- */ %{ +#include #include %} %include diff --git a/Lib/std/std_except.i b/Lib/std/std_except.i index c8820c2c5..728b9c8b5 100644 --- a/Lib/std/std_except.i +++ b/Lib/std/std_except.i @@ -3,6 +3,7 @@ #endif %{ +#include #include %} diff --git a/Lib/std_except.i b/Lib/std_except.i index d070d1b9c..50b5a88a2 100644 --- a/Lib/std_except.i +++ b/Lib/std_except.i @@ -24,6 +24,7 @@ #endif %{ +#include #include %}