vc++ warning suppression

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8545 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-01-24 21:42:02 +00:00
commit 199773979d
2 changed files with 16 additions and 0 deletions

View file

@ -36,6 +36,11 @@
}
%inline %{
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
// %exception tests
void ThrowByValue() { throw Ex("ThrowByValue"); }
void ThrowByReference() { throw Ex("ThrowByReference"); }
@ -101,6 +106,10 @@ struct constructor {
constructor(std::string s) {}
constructor() throw(int) { throw 10; }
};
#if defined(_MSC_VER)
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
%}
// test exception pending in the csout typemaps

View file

@ -32,6 +32,10 @@ template<class T> class vector {
void testconst(const T x) { }
};
#if defined(_MSC_VER)
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
class Base {
public:
Base() : mVectInt(0) {}
@ -53,6 +57,9 @@ public:
// virtual Base m3(Base b) { return b; }
void throwspec() throw (int, Base) {}
};
#if defined(_MSC_VER)
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
%}
%template(maxint) maximum<int>;