Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1#ifndef _H_MACROS_
2#define _H_MACROS_
3
4#ifdef DEBUG
5#define ASSERTLINE(line, cond) \
6 ((cond) || (OSPanic(__FILE__, line, "Failed assertion " #cond), 0))
7
8#define ASSERTMSGLINE(line, cond, msg) \
9 ((cond) || (OSPanic(__FILE__, line, msg), 0))
10
11// This is dumb but we dont have a Metrowerks way to do variadic macros in the macro to make this done in a not scrubby way.
12#define ASSERTMSG1LINE(line, cond, msg, arg1) \
13 ((cond) || (OSPanic(__FILE__, line, msg, arg1), 0))
14
15#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) \
16 ((cond) || (OSPanic(__FILE__, line, msg, arg1, arg2), 0))
17
18#define ASSERTMSGLINEV(line, cond, ...) \
19 ((cond) || (OSPanic(__FILE__, line, __VA_ARGS__), 0))
20
21#else
22#define ASSERTLINE(line, cond) (void)0
23#define ASSERTMSGLINE(line, cond, msg) (void)0
24#define ASSERTMSG1LINE(line, cond, msg, arg1) (void)0
25#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) (void)0
26#define ASSERTMSGLINEV(line, cond, ...) (void)0
27#endif
28
29#define ASSERT(cond) ASSERTLINE(__LINE__, cond)
30
31#endif // _H_MACROS_