Add C++ version check for likely/unlikely attributes

This commit is contained in:
Jelle
2025-10-06 15:08:45 +01:00
committed by Martin Leitner-Ankerl
parent a3a17f01e8
commit 651d9eb217

View File

@@ -143,7 +143,7 @@
# pragma intrinsic(_umul128)
# endif
# if __has_cpp_attribute(likely) && __has_cpp_attribute(unlikely)
# if __has_cpp_attribute(likely) && __has_cpp_attribute(unlikely) && ANKERL_UNORDERED_DENSE_CPP_VERSION >= 202002L
# define ANKERL_UNORDERED_DENSE_LIKELY_ATTR [[likely]] // NOLINT(cppcoreguidelines-macro-usage)
# define ANKERL_UNORDERED_DENSE_UNLIKELY_ATTR [[unlikely]] // NOLINT(cppcoreguidelines-macro-usage)
# define ANKERL_UNORDERED_DENSE_LIKELY(x) (x) // NOLINT(cppcoreguidelines-macro-usage)