mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-02 16:47:59 -04:00
Use real line numbers for asserts
Redefine the macros to use __LINE__
This commit is contained in:
@@ -306,6 +306,8 @@ extern int __OSInIPL;
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#if __MWERKS__
|
||||
|
||||
#define ASSERTLINE(line, cond) \
|
||||
((cond) || (OSPanic(__FILE__, line, "Failed assertion " #cond), 0))
|
||||
|
||||
@@ -321,6 +323,25 @@ extern int __OSInIPL;
|
||||
#define ASSERTMSGLINEV(line, cond, ...) \
|
||||
((cond) || (OSPanic(__FILE__, line, __VA_ARGS__), 0))
|
||||
|
||||
#else
|
||||
|
||||
#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))
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define ASSERTLINE(line, cond) (void)0
|
||||
#define ASSERTMSGLINE(line, cond, msg) (void)0
|
||||
|
||||
Reference in New Issue
Block a user