diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 60c28c7..19027cd 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -257,6 +257,7 @@ using parse_options = parse_options_t; // (the macro supplies the parentheses). It expands to the standard [[unlikely]] // attribute when supported, otherwise to __builtin_expect on GCC/Clang, or // to a no-op elsewhere (e.g. pre-C++20 MSVC, which has no equivalent hint). +#if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) #ifdef __has_cpp_attribute #if __has_cpp_attribute(unlikely) >= 201803L // g++-9 hits hits this branch, but then fails to compile @@ -266,6 +267,7 @@ using parse_options = parse_options_t; #endif #endif #endif +#endif #ifdef FASTFLOAT_USE_UNLIKELY_ATTR #define fastfloat_unlikely(x) (x) [[unlikely]]