Merge pull request #392 from biojppm/fix/gcc9_compile_error

Fix compile error with gcc 9: use of [[unlikely]]
This commit is contained in:
Daniel Lemire 2026-06-11 09:37:38 -04:00 committed by GitHub
commit 30868f8734
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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