Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
macros.h
Go to the documentation of this file.
1 #ifndef _MACROS_H_
2 #define _MACROS_H_
3 
4 #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
5 
6 #define GLUE(a, b) a ## b
7 #define GLUE2(a, b) GLUE(a, b)
8 
9 // Avoid compiler warnings for unused variables
10 #ifdef __GNUC__
11 #define UNUSED __attribute__((unused))
12 #else
13 #define UNUSED
14 #endif
15 
16 // Ignore GLOBAL_ASM blocks when syntax-checking with GCC
17 #ifdef __GNUC__
18 #define GLOBAL_ASM(...)
19 #endif
20 
21 // Static assertions
22 #ifdef __GNUC__
23 #define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
24 #else
25 #define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
26 #endif
27 
28 #endif