From 588769021d4e239bc76779fc5b3f0d00869a1252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 1 Oct 2023 22:39:13 +0200 Subject: [PATCH] Don't use [[unlikely]] --- src/util/assert.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/assert.h b/src/util/assert.h index 5aa1cc996bc4..f53c64cd3865 100644 --- a/src/util/assert.h +++ b/src/util/assert.h @@ -39,7 +39,7 @@ inline void mixxx_release_assert(const char* assertion, const char* file, int li /// corrupting user data. Handle errors gracefully whenever possible. #define RELEASE_ASSERT(cond) \ do \ - if (!static_cast(cond)) [[unlikely]] { \ + if (Q_UNLIKELY(!static_cast(cond))) { \ mixxx_release_assert(#cond, __FILE__, __LINE__, ASSERT_FUNCTION); \ } \ while (0) @@ -56,7 +56,7 @@ inline void mixxx_release_assert(const char* assertion, const char* file, int li #ifdef MIXXX_DEBUG_ASSERTIONS_ENABLED #define DEBUG_ASSERT(cond) \ do \ - if (!static_cast(cond)) [[unlikely]] { \ + if (Q_UNLIKELY(!static_cast(cond))) { \ mixxx_debug_assert(#cond, __FILE__, __LINE__, ASSERT_FUNCTION); \ } \ while (0) @@ -80,5 +80,5 @@ inline void mixxx_release_assert(const char* assertion, const char* file, int li if (Q_UNLIKELY(!static_cast(cond)) && \ mixxx_debug_assert_return_true(#cond, __FILE__, __LINE__, ASSERT_FUNCTION)) #else -#define VERIFY_OR_DEBUG_ASSERT(cond) if (!static_cast(cond)) [[unlikely]] +#define VERIFY_OR_DEBUG_ASSERT(cond) if (Q_UNLIKELY(!static_cast(cond))) #endif