From 6cc6d21bd201a439c35c1dedba26dc1c3efd0b1e Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 3 May 2018 21:55:47 +0100 Subject: [PATCH] test-suite fix for c++17 and throw macro --- Examples/test-suite/director_exception.i | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Examples/test-suite/director_exception.i b/Examples/test-suite/director_exception.i index 78bd715cd..8c2ccc61b 100644 --- a/Examples/test-suite/director_exception.i +++ b/Examples/test-suite/director_exception.i @@ -2,18 +2,6 @@ %warnfilter(SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) return_const_char_star; -%{ -// throw is deprecated in C++11 and invalid in C++17 and later -#if defined(__cplusplus) && __cplusplus >= 201103L -#define throw(TYPES...) -#else -#define throw(TYPES...) throw(TYPES) -#if defined(_MSC_VER) - #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) -#endif -#endif -%} - %{ #include @@ -127,6 +115,18 @@ Foo *launder(Foo *f) { %feature("director") Bar; %feature("director") ReturnAllTypes; +%{ +// throw is deprecated in C++11 and invalid in C++17 and later +#if defined(__cplusplus) && __cplusplus >= 201103L +#define throw(TYPES...) +#else +#define throw(TYPES...) throw(TYPES) +#if defined(_MSC_VER) + #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#endif +#endif +%} + %inline %{ struct Exception1 {