summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-03-15 22:31:13 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-03-15 22:31:13 -0700
commit951c8f15d24a05a30a59f399b121a53a63ff3d41 (patch)
tree341aadf475d15be1fda9d143213d3388aedcc6e3
parent655bc825a1a2356e32059a685138960857c5481b (diff)
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.
-rw-r--r--src/pugixml.hpp24
1 files changed, 11 insertions, 13 deletions
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