From fe53b12fecd354b11d946c4bfe5cc509f6dbdb5d Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Thu, 21 Dec 2023 17:56:21 +0100 Subject: [PATCH] Eliminate constexpr support for vc141 or lower --- math/wide_integer/uintwide_t.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/math/wide_integer/uintwide_t.h b/math/wide_integer/uintwide_t.h index 1422ddc..7750398 100644 --- a/math/wide_integer/uintwide_t.h +++ b/math/wide_integer/uintwide_t.h @@ -95,26 +95,31 @@ #if defined(_MSVC_LANG) #if (_MSVC_LANG >= 201402L) - #define WIDE_INTEGER_CONSTEXPR constexpr // NOLINT(cppcoreguidelines-macro-usage) - #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 1 // NOLINT(cppcoreguidelines-macro-usage) + #if (defined(_MSC_VER) && (_MSC_VER < 1920)) + #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) + #else + #define WIDE_INTEGER_CONSTEXPR constexpr // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 1 // NOLINT(cppcoreguidelines-macro-usage) + #endif #else - #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) - #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) #endif #else #if (defined(__AVR__) && (defined(__GNUC__) && (__GNUC__ < 10))) - #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) - #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) #elif (defined(__MINGW32__) && (defined(__GNUC__) && (__GNUC__ < 9))) - #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) - #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) #else #if (__cplusplus >= 201402L) - #define WIDE_INTEGER_CONSTEXPR constexpr // NOLINT(cppcoreguidelines-macro-usage) - #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 1 // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR constexpr // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 1 // NOLINT(cppcoreguidelines-macro-usage) #else - #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) - #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR // NOLINT(cppcoreguidelines-macro-usage) + #define WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST 0 // NOLINT(cppcoreguidelines-macro-usage) #endif #endif #endif