mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-24 15:00:55 -04:00
178194ccb2
* switch to dtk setup * some cleanup / fixes * cleanup d_a_alink literals * Restore doxygen, update CI & README.md (#1) * Fix build image ref (#2) --------- Co-authored-by: Luke Street <luke@street.dev>
32 lines
1.0 KiB
C
32 lines
1.0 KiB
C
#ifndef _H_MACROS_
|
|
#define _H_MACROS_
|
|
|
|
#ifdef DEBUG
|
|
#define ASSERTLINE(line, cond) \
|
|
((cond) || (OSPanic(__FILE__, line, "Failed assertion " #cond), 0))
|
|
|
|
#define ASSERTMSGLINE(line, cond, msg) \
|
|
((cond) || (OSPanic(__FILE__, line, msg), 0))
|
|
|
|
// 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.
|
|
#define ASSERTMSG1LINE(line, cond, msg, arg1) \
|
|
((cond) || (OSPanic(__FILE__, line, msg, arg1), 0))
|
|
|
|
#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) \
|
|
((cond) || (OSPanic(__FILE__, line, msg, arg1, arg2), 0))
|
|
|
|
#define ASSERTMSGLINEV(line, cond, ...) \
|
|
((cond) || (OSPanic(__FILE__, line, __VA_ARGS__), 0))
|
|
|
|
#else
|
|
#define ASSERTLINE(line, cond) (void)0
|
|
#define ASSERTMSGLINE(line, cond, msg) (void)0
|
|
#define ASSERTMSG1LINE(line, cond, msg, arg1) (void)0
|
|
#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) (void)0
|
|
#define ASSERTMSGLINEV(line, cond, ...) (void)0
|
|
#endif
|
|
|
|
#define ASSERT(cond) ASSERTLINE(__LINE__, cond)
|
|
|
|
#endif // _H_MACROS_
|