assert.h: add [[unlikely]] (#6454)

clang format assert
This commit is contained in:
SachinVin 2023-04-22 14:36:27 +05:30 committed by GitHub
parent c9b2bd9077
commit 7197367040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@
#define ASSERT(_a_) \ #define ASSERT(_a_) \
do \ do \
if (!(_a_)) { \ if (!(_a_)) [[unlikely]] { \
[]() CITRA_NO_INLINE { \ []() CITRA_NO_INLINE { \
LOG_CRITICAL(Debug, "Assertion Failed!"); \ LOG_CRITICAL(Debug, "Assertion Failed!"); \
Crash(); \ Crash(); \
@ -25,7 +25,7 @@
#define ASSERT_MSG(_a_, ...) \ #define ASSERT_MSG(_a_, ...) \
do \ do \
if (!(_a_)) { \ if (!(_a_)) [[unlikely]] { \
[&]() CITRA_NO_INLINE { \ [&]() CITRA_NO_INLINE { \
LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \ LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \
Crash(); \ Crash(); \