SSBM Decomp
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
12// macro to make this done in a not scrubby way.
13#define ASSERTMSG1LINE(line, cond, msg, arg1) \
14 ((cond) || (OSPanic(__FILE__, line, msg, arg1), 0))
15
16#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) \
17 ((cond) || (OSPanic(__FILE__, line, msg, arg1, arg2), 0))
18
19#define ASSERTMSGLINEV(line, cond, ...) \
20 ((cond) || (OSPanic(__FILE__, line, __VA_ARGS__), 0))
21
22#else
23#define ASSERTLINE(line, cond) (void) 0
24#define ASSERTMSGLINE(line, cond, msg) (void) 0
25#define ASSERTMSG1LINE(line, cond, msg, arg1) (void) 0
26#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) (void) 0
27#define ASSERTMSGLINEV(line, cond, ...) (void) 0
28#endif
29
30#define ASSERT(cond) ASSERTLINE(__LINE__, cond)
31
32#endif // _H_MACROS_