From 951c8f15d24a05a30a59f399b121a53a63ff3d41 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 15 Mar 2018 22:31:13 -0700 Subject: Refactor noexcept macros Define noexcept using _MSC_VER instead of _MSC_FULL_VER (first release of MSVC 2015 should have it), remove redundant PUGIXML_HAS_NOEXCEPT and define PUGIXML_NOEXCEPT_IF_NOT_COMPACT in terms of PUGIXML_NOEXCEPT. --- src/pugixml.hpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/pugixml.hpp b/src/pugixml.hpp index dc887a9..43256ec 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -82,23 +82,21 @@ #endif // If C++ is 2011 or higher, add 'noexcept' specifiers -#ifndef PUGIXML_HAS_NOEXCEPT +#ifndef PUGIXML_NOEXCEPT # if __cplusplus >= 201103 -# define PUGIXML_HAS_NOEXCEPT -# elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 -# define PUGIXML_HAS_NOEXCEPT -# endif -#endif -#ifdef PUGIXML_HAS_NOEXCEPT -# define PUGIXML_NOEXCEPT noexcept -# ifdef PUGIXML_COMPACT -# define PUGIXML_NOEXCEPT_IF_NOT_COMPACT +# define PUGIXML_NOEXCEPT noexcept +# elif defined(_MSC_VER) && _MSC_VER >= 1900 +# define PUGIXML_NOEXCEPT noexcept # else -# define PUGIXML_NOEXCEPT_IF_NOT_COMPACT noexcept +# define PUGIXML_NOEXCEPT # endif -#else -# define PUGIXML_NOEXCEPT +#endif + +// Some functions can not be noexcept in compact mode +#ifdef PUGIXML_COMPACT # define PUGIXML_NOEXCEPT_IF_NOT_COMPACT +#else +# define PUGIXML_NOEXCEPT_IF_NOT_COMPACT PUGIXML_NOEXCEPT #endif // If C++ is 2011 or higher, add 'override' qualifiers -- cgit v1.2.3