Browse Source

[common] asserts now display expression + file of assert

pull/2997/head
lizzie 1 month ago
committed by crueter
parent
commit
403af13c9d
  1. 4
      src/common/assert.h

4
src/common/assert.h

@ -25,7 +25,7 @@ void AssertFailSoftImpl();
#define ASSERT(_a_) \ #define ASSERT(_a_) \
([&]() YUZU_NO_INLINE { \ ([&]() YUZU_NO_INLINE { \
if (!(_a_)) [[unlikely]] { \ if (!(_a_)) [[unlikely]] { \
LOG_CRITICAL(Debug, "Assert"); \
LOG_CRITICAL(Debug, __FILE__ ":" #_a_ ": assert"); \
AssertFailSoftImpl(); \ AssertFailSoftImpl(); \
} \ } \
}()) }())
@ -33,7 +33,7 @@ void AssertFailSoftImpl();
#define ASSERT_MSG(_a_, ...) \ #define ASSERT_MSG(_a_, ...) \
([&]() YUZU_NO_INLINE { \ ([&]() YUZU_NO_INLINE { \
if (!(_a_)) [[unlikely]] { \ if (!(_a_)) [[unlikely]] { \
LOG_CRITICAL(Debug, "Assert\n" __VA_ARGS__); \
LOG_CRITICAL(Debug, __FILE__ ":" #_a_ ": assert\n" __VA_ARGS__); \
AssertFailSoftImpl(); \ AssertFailSoftImpl(); \
} \ } \
}()) }())

Loading…
Cancel
Save