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
|
|
@ -3,9 +3,9 @@
|
|||
%module java_throws
|
||||
|
||||
// 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)
|
||||
%}
|
||||
|
||||
// Exceptions are chosen at random but are ones which have to have a try catch block to compile
|
||||
|
|
@ -45,7 +45,7 @@ short full_of_exceptions(int num) {
|
|||
return $null;
|
||||
}
|
||||
%inline %{
|
||||
bool throw_spec_function(int value) TESTCASE_THROW(int) { throw (int)0; }
|
||||
bool throw_spec_function(int value) TESTCASE_THROW1(int) { throw (int)0; }
|
||||
%}
|
||||
|
||||
%catches(int) catches_function(int value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue