String macros (#1871)

* PRINTF

* T

* fault

* yaz0

* __osMalloc

* audio_thread_manager

* graph

* padmgr

* sched

* z_play

* z_arrow_ice

* z_arrow_light

* z_elf_msg

* z_elf_msg3

* z_elf_msg4

* z_elf_msg5

* z_mir_ray

* stackcheck

* Include versions in macros.h

* Fix workaround for permuter
This commit is contained in:
Derek Hensley
2026-04-21 05:12:46 -07:00
committed by GitHub
parent fa85e7cda5
commit 57e41795f5
22 changed files with 129 additions and 111 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ void CIC6105_AddRomInfoFaultPage(void);
void CIC6105_Destroy(void);
void CIC6105_Init(void);
#if MM_VERSION <= N64_JP_1_1
#if MM_VERSION < N64_US
void CIC6105_ScheduleCICTask(void);
#endif
+2 -2
View File
@@ -15,7 +15,7 @@ typedef struct ArenaNode {
/* 0x4 */ size_t size;
/* 0x8 */ struct ArenaNode* next;
/* 0xC */ struct ArenaNode* prev;
#if MM_VERSION <= N64_JP_1_1
#if MM_VERSION < N64_US
/* 0x10 */ const char* filename;
/* 0x14 */ int line;
/* 0x18 */ OSId threadId;
@@ -44,7 +44,7 @@ void* __osRealloc(Arena* arena, void* ptr, size_t newSize);
void __osGetSizes(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc);
s32 __osCheckArena(Arena* arena);
#if MM_VERSION <= N64_JP_1_1
#if MM_VERSION < N64_US
void *__osMallocDebug(Arena *arena, size_t size, const char* file, int line);
void *__osMallocRDebug(Arena *arena, size_t size, const char* file, int line);
void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line);
+32
View File
@@ -2,6 +2,7 @@
#define MACROS_H
#include "PR/ultratypes.h"
#include "versions.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@@ -71,4 +72,35 @@
} \
(void)0
/**
* The T macro holds translations in English for original debug strings written in Japanese.
* The translated strings match the original debug strings, they are only direct translations.
* For example, any original name is left as is rather than being replaced with the name in the codebase.
*/
#define T(jp, en) jp
// IDO doesn't support variadic macros, but it merely throws a warning for the
// number of arguments not matching the definition (warning 609) instead of
// throwing an error. We suppress this warning and rely on GCC to catch macro
// argument errors instead.
// Note some tools define __sgi but preprocess with a modern cpp implementation,
// ensure that these do not use the IDO workaround to avoid errors.
#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX && !PERMUTER)
#if DEBUG_FEATURES
#define PRINTF osSyncPrintf
#elif IDO_PRINTF_WORKAROUND
#if MM_VERSION >= N64_US
#define PRINTF(args) (void)0
#else
#define PRINTF(args) (void)(args)
#endif
#else
#if MM_VERSION >= N64_US
#define PRINTF(format, ...) (void)0
#else
#define PRINTF(format, ...) (void)(format)
#endif
#endif
#endif // MACROS_H