SSBM Decomp
Loading...
Searching...
No Matches
placeholder.h
Go to the documentation of this file.
1#ifndef PLACEHOLDER_H
2#define PLACEHOLDER_H
3
4#include <platform.h>
5
6#include <m2c_macros.h> // IWYU pragma: export
7
9typedef void (*jmp_t)(void);
10
12typedef jmp_t jtbl_t[];
13
14#if defined(__clang__) || defined(__GNUC__)
15#include <dolphin/os/OSError.h>
16#define NOT_IMPLEMENTED \
17 OSPanic(__FILE__, __LINE__, "%s is not implemented!", __func__)
18#elif defined(__MWERKS__) && !defined(BUGFIX)
19#define NOT_IMPLEMENTED asm { nop }
20#else
21#include <dolphin/OSError.h>
22#define NOT_IMPLEMENTED
23OSPanic(__FILE__, __LINE__, "Function is not implemented!")
24#endif
25
26#ifndef UNK_T
27#ifdef M2CTX
28#define UNK_T M2C_UNK
29#else
30#define UNK_T void*
31#endif
32#endif
33
34#ifndef UNK_RET
35#ifdef M2CTX
36#define UNK_RET M2C_UNK
37#else
38#define UNK_RET void
39#endif
40#endif
41
42#ifndef UNK_PARAMS
43#ifdef M2CTX
44#define UNK_PARAMS
45#else
46#define UNK_PARAMS void
47#endif
48#endif
49
50#ifndef UNK_SIZE_ARRAY
51#if defined(__MWERKS__) && !defined(M2CTX)
52#define UNK_SIZE_ARRAY []
53#else
54#define UNK_SIZE_ARRAY [0]
55#endif
56#endif
57
58#define U32_TO_F32 4503599627370496.0
59#define S32_TO_F32 4503601774854144.0
60
61#ifdef MWERKS_GEKKO
62#define ASM asm
63#else
64#define ASM
65#endif
66
67#ifndef UNUSED
68#if defined(__clang__) || defined(__GNUC__)
69#define UNUSED __attribute__((unused))
70#else
71#define UNUSED
72#endif
73#endif
74
75#define PAD_STACK(bytes) \
76 do { \
77 UNUSED unsigned char _[(bytes)]; \
78 } while (0)
79
81#define FORCE_PAD_STACK(bytes) \
82 do { \
83 UNUSED unsigned char _[(bytes)] = { 0 }; \
84 } while (0)
85
86#define FORCE_PAD_STACK_8 \
87 do { \
88 UNUSED u64 _0 = 0; \
89 } while (0)
90
91#define FORCE_PAD_STACK_16 \
92 do { \
93 UNUSED u64 _0 = 0, _1 = 0; \
94 } while (0)
95
96#define FORCE_PAD_STACK_32 \
97 do { \
98 UNUSED u64 _0 = 0, _1 = 0, _2 = 0, _3 = 0; \
99 } while (0)
100#endif
void OSPanic(char *file, int line, char *msg,...)
Definition OSError.c:21
#define __FILE__
Definition ftYs_Init.c:2
This header contains macros emitted by m2c in "valid syntax" mode, which can be enabled by passing --...
void(* jmp_t)(void)
A label in a jump table.
Definition placeholder.h:9
jmp_t jtbl_t[]
A jump table.
Definition placeholder.h:12