Fix compile error with gcc 9: use of [[unlikely]]

This commit is contained in:
Joao Paulo Magalhaes 2026-06-10 13:20:58 +01:00
parent e8ec8e8f34
commit 8e6edc8ad2
No known key found for this signature in database

View File

@ -207,7 +207,11 @@ using parse_options = parse_options_t<char>;
// to a no-op elsewhere (e.g. pre-C++20 MSVC, which has no equivalent hint).
#ifdef __has_cpp_attribute
#if __has_cpp_attribute(unlikely) >= 201803L
#define FASTFLOAT_USE_UNLIKELY_ATTR 1
// g++-9 hits hits this branch, but then fails to compile
// [[unlikely]]. This happens only with g++-9.
#if !defined(__GNUC__) || (__GNUC__ != 9)
#define FASTFLOAT_USE_UNLIKELY_ATTR
#endif
#endif
#endif