From 84feeb0f360235564822fea19cb48d35ea88b153 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 7 May 2021 17:14:29 -0700 Subject: [PATCH] Remove redundant comments and put common case check first --- include/fmt/core.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 10ac2843..d2a6e92c 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -45,27 +45,17 @@ #endif // Check if constexpr std::char_traits<>::compare,length is supported. -// -// libstdc++: GCC 7 and newer and __cplusplus >= 201703L -// MSVC : VS 2017 15.7 and newer and /std:c++17 -// https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance -// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros -// libc++ : 4.0 and newer and if __cplusplus >= 201703L -// https://libcxx.llvm.org/docs/Cxx1zStatus.html -// -// NOTE: FMT_GCC_VERSION - is not libstdc++ version. -// _GLIBCXX_RELEASE - is present in GCC 7 libstdc++ and newer. -#if defined(_MSC_VER) -# if _MSVC_LANG >= 201703L && _MSC_VER >= 1914 +#if defined(__GLIBCXX__) +# if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \ + _GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE. # define FMT_CONSTEXPR_CHAR_TRAITS constexpr # endif #elif defined(_LIBCPP_VERSION) # if __cplusplus >= 201703L && _LIBCPP_VERSION >= 4000 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr # endif -#elif defined(__GLIBCXX__) -# if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \ - _GLIBCXX_RELEASE >= 7 +#elif defined(_MSC_VER) +# if _MSVC_LANG >= 201703L && _MSC_VER >= 1914 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr # endif #endif