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.h>
16#define NOT_IMPLEMENTED \
17 OSPanic(__FILE__, __LINE__, "%s is not implemented!", __func__)
18#elif M2CTX
19#define NOT_IMPLEMENTED
20#elif defined(__MWERKS__) && !defined(BUGFIX)
21#define NOT_IMPLEMENTED asm { nop }
22#else
23#include <dolphin/os.h>
24#define NOT_IMPLEMENTED \
25 OSPanic(__FILE__, __LINE__, "Function is not implemented!")
26#endif
27
28#ifndef UNK_T
29#ifdef M2CTX
30#define UNK_T M2C_UNK
31#else
32#define UNK_T void*
33#endif
34#endif
35
36#ifndef UNK_RET
37#ifdef M2CTX
38#define UNK_RET M2C_UNK
39#else
40#define UNK_RET void
41#endif
42#endif
43
44#ifndef UNK_PARAMS
45#ifdef M2CTX
46#define UNK_PARAMS
47#else
48#define UNK_PARAMS void
49#endif
50#endif
51
52#ifndef UNK_SIZE_ARRAY
53#if defined(__MWERKS__) && !defined(M2CTX)
54#define UNK_SIZE_ARRAY []
55#else
56#define UNK_SIZE_ARRAY [0]
57#endif
58#endif
59
60#define U32_TO_F32 4503599627370496.0
61#define S32_TO_F32 4503601774854144.0
62
63#ifdef MWERKS_GEKKO
64#define ASM asm
65#else
66#define ASM
67#endif
68
69#ifndef UNUSED
70#if defined(__clang__) || defined(__GNUC__)
71#define UNUSED __attribute__((unused))
72#else
73#define UNUSED
74#endif
75#endif
76
77#define PAD_STACK(bytes) \
78 do { \
79 UNUSED unsigned char _[(bytes)]; \
80 } while (0)
81
83#define FORCE_PAD_STACK(bytes) \
84 do { \
85 UNUSED unsigned char _[(bytes)] = { 0 }; \
86 } while (0)
87
88#define FORCE_PAD_STACK_8 \
89 do { \
90 UNUSED u64 _0 = 0; \
91 } while (0)
92
93#define FORCE_PAD_STACK_16 \
94 do { \
95 UNUSED u64 _0 = 0, _1 = 0; \
96 } while (0)
97
98#define FORCE_PAD_STACK_32 \
99 do { \
100 UNUSED u64 _0 = 0, _1 = 0, _2 = 0, _3 = 0; \
101 } while (0)
102#endif
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