Skip to content

Commit

Permalink
Don't use [[unlikely]]
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Oct 6, 2023
1 parent d444dd3 commit 5887690
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>(cond)) [[unlikely]] { \
if (Q_UNLIKELY(!static_cast<bool>(cond))) { \
mixxx_release_assert(#cond, __FILE__, __LINE__, ASSERT_FUNCTION); \
} \
while (0)
Expand All @@ -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<bool>(cond)) [[unlikely]] { \
if (Q_UNLIKELY(!static_cast<bool>(cond))) { \
mixxx_debug_assert(#cond, __FILE__, __LINE__, ASSERT_FUNCTION); \
} \
while (0)
Expand All @@ -80,5 +80,5 @@ inline void mixxx_release_assert(const char* assertion, const char* file, int li
if (Q_UNLIKELY(!static_cast<bool>(cond)) && \
mixxx_debug_assert_return_true(#cond, __FILE__, __LINE__, ASSERT_FUNCTION))
#else
#define VERIFY_OR_DEBUG_ASSERT(cond) if (!static_cast<bool>(cond)) [[unlikely]]
#define VERIFY_OR_DEBUG_ASSERT(cond) if (Q_UNLIKELY(!static_cast<bool>(cond)))
#endif

0 comments on commit 5887690

Please sign in to comment.