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:
parent
1c46662c39
commit
196a965067
19 changed files with 127 additions and 117 deletions
|
|
@ -13,9 +13,9 @@
|
|||
%include "exception.i"
|
||||
|
||||
// throw is invalid in C++17 and later, only SWIG to use it
|
||||
#define TESTCASE_THROW(TYPES...) throw(TYPES)
|
||||
#define TESTCASE_THROW1(T1) throw(T1)
|
||||
%{
|
||||
#define TESTCASE_THROW(TYPES...)
|
||||
#define TESTCASE_THROW1(T1)
|
||||
%}
|
||||
|
||||
/*
|
||||
|
|
@ -99,16 +99,16 @@
|
|||
int efoovar;
|
||||
|
||||
/* caught by the user's throw definition */
|
||||
int foo() TESTCASE_THROW(E1)
|
||||
int foo() TESTCASE_THROW1(E1)
|
||||
{
|
||||
throw E1();
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bar() TESTCASE_THROW(E2)
|
||||
|
||||
int bar() TESTCASE_THROW1(E2)
|
||||
{
|
||||
throw E2();
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* caught by %postexception */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue