test-suite fixes for compilers that don't support vararg macros

Split TESTCASE_THROW into multiple macros taking different number of arguments.
Fixes Visual Studio compiler errors.
This commit is contained in:
William S Fulton 2018-05-05 11:45:44 +01:00
commit 196a965067
19 changed files with 127 additions and 117 deletions

View file

@ -5,9 +5,9 @@
#endif
// throw is invalid in C++17 and later, only SWIG to use it
#define TESTCASE_THROW(TYPES...) throw(TYPES)
#define TESTCASE_THROW2(T1, T2) throw(T1, T2)
%{
#define TESTCASE_THROW(TYPES...)
#define TESTCASE_THROW2(T1, T2)
%}
%inline %{
@ -16,7 +16,7 @@
int x;
virtual ~Foo() { }
virtual Foo* blah() { return this; }
virtual Foo* exception_spec(int what_to_throw) TESTCASE_THROW(int, const char *) {
virtual Foo* exception_spec(int what_to_throw) TESTCASE_THROW2(int, const char *) {
int num = 10;
const char *str = "exception message";
if (what_to_throw == 1) throw num;