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) \
+1 -1
View File
@@ -11,7 +11,7 @@ s32 LOAD_COPYDATE(void*);
extern OSThread mainThread;
#define HeapCheckTableNum 6
const int HeapCheckTableNum = 6;
class HeapCheck {
public:
+1 -1
View File
@@ -7,7 +7,7 @@
#include "d/actor/d_a_bomb2.h"
#include "JSystem/JUtility/JUTAssert.h"
#define L_daBomb_Version 1
const int L_daBomb_Version = 1;
/* 80067FA0-80067FD0 .text getBombRestTime__8daBomb_cFv */
s16 daBomb_c::getBombRestTime() {