Fix JUT_ASSERT and several other macros (#2711)

* Fix JUT_ASSERT to be a nested define

* Switch names that appear in asserts to be constants instead of defines

* Replace `0` in asserts with `NULL` or `FALSE`

* Fix fpclassify

* Fix ARRAY_SIZE

* Use G_CM3D_F_INF

* More fixes for fpclassify

* Remove FLOAT_LABEL

* Remove incorrect FLAG_ON macro

* Remove UNK_BSS macro

* Silence clangd unused header warning for PCH
This commit is contained in:
LagoLunatic
2025-09-28 16:11:07 -04:00
committed by GitHub
parent 737250d7f5
commit 6ec6fce8cb
1008 changed files with 3172 additions and 3237 deletions
+2 -9
View File
@@ -23,8 +23,8 @@
#define ALIGN_DECL(ALIGNMENT) __attribute__((aligned(ALIGNMENT)))
#define ARRAY_SIZE(o) (s32)(sizeof((o)) / sizeof(*(o)))
#define ARRAY_SIZEU(o) (sizeof((o)) / sizeof(*(o)))
#define ARRAY_SIZE(o) (s32)(sizeof(o) / sizeof(o[0]))
#define ARRAY_SIZEU(o) (sizeof(o) / sizeof(o[0]))
// Align X to the previous N bytes (N must be power of two)
#define ALIGN_PREV(X, N) ((X) & ~((N)-1))
@@ -37,10 +37,6 @@
#define TRUNC(n, a) (((u32)(n)) & ~((a)-1))
#define JUT_EXPECT(...)
#define FLAG_ON(V, F) (((V) & (F)) == 0)
#define FLOAT_LABEL(x) (*(f32*)&x)
#define DOUBLE_LABEL(x) (*(f64*)&x)
#define _SDA_BASE_(dummy) 0
#define _SDA2_BASE_(dummy) 0
@@ -76,9 +72,6 @@ void* __memcpy(void*, const void*, int);
// hack to make strings with no references compile properly
#define DEAD_STRING(s) OSReport(s)
#define UNK_BSS(name) \
static u8 lit_##name[1 + 3 /* padding */];
#define READU32_BE(ptr, offset) \
(((u32)ptr[offset] << 24) | ((u32)ptr[offset + 1] << 16) | ((u32)ptr[offset + 2] << 8) | (u32)ptr[offset + 3]);