From 8ba34a8f52146898f0550857615ed86ed542e86f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 13 Jan 2006 23:40:42 +0000 Subject: [PATCH] mods for VC++ git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8420 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/li_std_except.i | 6 ++++++ Examples/test-suite/li_std_string.i | 8 ++++++++ Examples/test-suite/python/li_std_string.i | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/Examples/test-suite/li_std_except.i b/Examples/test-suite/li_std_except.i index e266ce624..fc886dca7 100644 --- a/Examples/test-suite/li_std_except.i +++ b/Examples/test-suite/li_std_except.i @@ -2,6 +2,12 @@ %include +%{ +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif +%} + %inline %{ struct E1 : public std::exception diff --git a/Examples/test-suite/li_std_string.i b/Examples/test-suite/li_std_string.i index 32e9f95c8..a4b8c3641 100644 --- a/Examples/test-suite/li_std_string.i +++ b/Examples/test-suite/li_std_string.i @@ -35,6 +35,10 @@ std::string& test_reference_out() { return x; } +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + void test_throw() throw(std::string){ static std::string x = "test_throw message"; throw x; @@ -53,6 +57,10 @@ void test_const_pointer_throw() throw(const std::string *) { throw new std::string("foo"); } +#if defined(_MSC_VER) + #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + %} %apply const std::string& { std::string *GlobalString2, diff --git a/Examples/test-suite/python/li_std_string.i b/Examples/test-suite/python/li_std_string.i index 1f769bb20..4eefa7a1a 100644 --- a/Examples/test-suite/python/li_std_string.i +++ b/Examples/test-suite/python/li_std_string.i @@ -65,12 +65,20 @@ std::string& test_reference_out() { return x; } +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + void test_throw() throw(std::string){ static std::string x = "x"; throw x; } +#if defined(_MSC_VER) + #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + std::basic_string test_value_basic1(std::basic_string x) { return x;