Fix JUT_ASSERT to use double defines

We know JUT_ASSERT originally had double defines because defines such as NULL and ARRAY_SIZE are expanded in assertion strings, as discovered by Jasper:
https://godbolt.org/z/PvqsG9asb
This commit is contained in:
LagoLunatic
2024-06-22 09:54:20 -04:00
parent c9e6b0c676
commit 0d66571e86
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -4,7 +4,9 @@
#include "dolphin/types.h"
#include "dolphin/os/OS.h"
#define JUT_ASSERT(LINE, COND) (void)((COND) || (JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND), OSPanic(__FILE__, LINE, "Halt"), 0));
#define JUT_SHOW_ASSERT(LINE, COND) JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND)
#define JUT_ASSERT(LINE, COND) (void)((COND) || (JUT_SHOW_ASSERT(LINE, COND), OSPanic(__FILE__, LINE, "Halt"), 0));
// Favored by JAI (JAudio)
#define JUT_ASSERT_MSG(LINE, COND, MSG) \