NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
types.h
1
#pragma once
2
3
#ifdef __cplusplus
4
#include <cstdarg>
5
#include <cstddef>
6
#include <new>
7
#else
8
#include <stdarg.h>
9
#include <stddef.h>
10
#endif
11
12
// Codewarrior-specific pragmas
13
#ifdef __CWCC__
14
#pragma cpp1x on
15
#pragma gcc_extensions on
16
#endif
17
18
// Base types
19
typedef
unsigned
char
u8;
20
typedef
unsigned
char
byte_t;
21
typedef
unsigned
short
u16;
22
typedef
unsigned
short
byte2_t;
23
typedef
unsigned
int
u32;
24
typedef
unsigned
int
byte4_t;
25
typedef
unsigned
long
long
u64;
26
typedef
signed
char
s8;
27
typedef
signed
short
s16;
28
typedef
signed
int
s32;
29
typedef
signed
long
long
s64;
30
typedef
float
f32;
31
typedef
double
f64;
32
typedef
unsigned
long
ulong;
33
typedef
volatile
s8 vs8;
34
typedef
volatile
s16 vs16;
35
typedef
volatile
s32 vs32;
36
typedef
volatile
s64 vs64;
37
typedef
volatile
u8 vu8;
38
typedef
volatile
u16 vu16;
39
typedef
volatile
u32 vu32;
40
typedef
volatile
u64 vu64;
41
typedef
volatile
f32 vf32;
42
typedef
volatile
f64 vf64;
43
44
typedef
int
UNKWORD;
45
typedef
void
UNKTYPE;
46
47
enum
{ FALSE, TRUE };
48
typedef
int
BOOL;
49
50
// Macros
51
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
52
#define BIT_FLAG(bit) ((bit) < 0 ? 0 : 1 << (bit))
53
#define ROUND_UP(x, align) (((x) + (align) - 1) & (-(align)))
54
#define ROUND_UP_PTR(x, align) ((void*)((((u32)(x)) + (align) - 1) & (~((align) - 1))))
55
56
// No-op on release
57
#define EGG_ASSERT(...)
58
#define EGG_ASSERT_MSG(...)
59
60
#ifndef NULL
61
#define NULL 0
62
#endif
// NULL
63
64
#ifndef nullptr
65
#define nullptr 0
66
#endif
// nullptr
67
68
#define DECL_SECTION(x) __declspec(section x)
69
#define DECL_WEAK __declspec(weak)
70
#define ATTR_UNUSED
71
72
#ifdef __CWCC__
73
#define NOINLINE __attribute__((noinline))
74
#define ALIGN(x) __attribute__((aligned(x)))
75
#define DECOMP_INLINE inline
76
#define DECOMP_DONT_INLINE __attribute__((never_inline))
77
#define DONT_INLINE __attribute__((never_inline))
78
#define AT_ADDRESS(x) : x
79
#define override
80
81
// Static assert
82
#define GLUE(a, b) a##b
83
#define GLUE2(a, b) GLUE(a, b)
84
#define STATIC_ASSERT(cond) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
85
#else
86
#define NOINLINE
87
#define ALIGN(x)
88
#define DECOMP_INLINE
89
#define DECOMP_DONT_INLINE
90
#define DONT_INLINE
91
#define AT_ADDRESS(x)
92
#define STATIC_ASSERT(...)
93
#endif
include
types.h
Made with ❤️ by
CLF78
and
RootCubed
. Logos by
Chasical
and
B1
. Website generated by
Doxygen
1.13.2