diff --git a/SWIG/Examples/python/exception/example.h b/SWIG/Examples/python/exception/example.h index 4896059f5..8f9a977b0 100644 --- a/SWIG/Examples/python/exception/example.h +++ b/SWIG/Examples/python/exception/example.h @@ -16,6 +16,10 @@ public: char msg[256]; }; +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + class Test { public: int simple() throw(int) { @@ -43,8 +47,7 @@ public: } }; +#if defined(_MSC_VER) + #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif - - - - diff --git a/SWIG/Examples/python/exceptshadow/example.h b/SWIG/Examples/python/exceptshadow/example.h index 9facde4bd..ec7107a5e 100644 --- a/SWIG/Examples/python/exceptshadow/example.h +++ b/SWIG/Examples/python/exceptshadow/example.h @@ -8,6 +8,10 @@ class FullError { FullError(int m) : maxsize(m) { } }; +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif + template class Queue { int maxsize; T *items; @@ -44,8 +48,7 @@ template class Queue { }; +#if defined(_MSC_VER) + #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif - - - -