clean up preprocessor directives.

This commit is contained in:
greg
2020-07-19 12:52:52 -04:00
parent 96619cd132
commit b47713c2c2
2 changed files with 13 additions and 7 deletions
+10 -4
View File
@@ -109,6 +109,7 @@
#endif
// -----------------------------------------------------------------------------
// Compiler Feature Checks
// -----------------------------------------------------------------------------
@@ -119,6 +120,12 @@
#define PHMAP_HAVE_BUILTIN(x) 0
#endif
#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703) || __cplusplus >= 201703
#define PHMAP_HAVE_CC17 1
#else
#define PHMAP_HAVE_CC17 0
#endif
// ----------------------------------------------------------------
// Checks whether `std::is_trivially_destructible<T>` is supported.
// ----------------------------------------------------------------
@@ -304,8 +311,7 @@
// #pragma message(PHMAP_VAR_NAME_VALUE(_MSVC_LANG))
#if defined(_MSC_VER) && _MSC_VER >= 1910 && \
((defined(_MSVC_LANG) && _MSVC_LANG >= 201703) || __cplusplus >= 201703)
#if defined(_MSC_VER) && _MSC_VER >= 1910 && PHMAP_HAVE_CC17
// #define PHMAP_HAVE_STD_ANY 1
#define PHMAP_HAVE_STD_OPTIONAL 1
#define PHMAP_HAVE_STD_VARIANT 1
@@ -314,7 +320,7 @@
#endif
#endif
#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703) || __cplusplus >= 201703
#if PHMAP_HAVE_CC17
#define PHMAP_HAVE_SHARED_MUTEX 1
#endif
@@ -633,7 +639,7 @@
// ----------------------------------------------------------------------
// constexpr if
// ----------------------------------------------------------------------
#if __cplusplus >= 201703 || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703)
#if PHMAP_HAVE_CC17
#define PHMAP_IF_CONSTEXPR(expr) if constexpr ((expr))
#else
#define PHMAP_IF_CONSTEXPR(expr) if ((expr))