From b133b769aaee98566e695191476f59f32eece591 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Wed, 4 Apr 2018 00:33:26 +1200 Subject: [PATCH] add #define to manage dynamic exception deprecation in c++11/14 --- IlmBase/Iex/IexBaseExc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/IlmBase/Iex/IexBaseExc.h b/IlmBase/Iex/IexBaseExc.h index bf016f76c8..65f31e229a 100644 --- a/IlmBase/Iex/IexBaseExc.h +++ b/IlmBase/Iex/IexBaseExc.h @@ -50,6 +50,25 @@ #include #include +//---------------------------------------------------------- +// +// C++11 deprecates the specification of dynamic exception throw and +// then changes this again in C++17. for convenience, put a macro +// here to enable existing places to specify the exception list, and +// have it done so appropriately based on the language features +// active. +// +//---------------------------------------------------------- +#ifdef ILMBASE_FORCE_CXX03 +# define IEX_THROW_SPEC(...) throw (__VA_ARGS__) +#else +# if __cplusplus <= 201402L +# define IEX_THROW_SPEC(...) +# else +# define IEX_THROW_SPEC(...) throw (__VA_ARGS__) +# endif +#endif + IEX_INTERNAL_NAMESPACE_HEADER_ENTER