mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-03 04:11:02 -07:00
Converted log_failure and fatal to macros (fixes GEN_PANIC not determining correct line or file)
This commit is contained in:
@ -33,5 +33,27 @@ void assert_handler( char const* condition, char const* file, s32 line, char con
|
||||
s32 assert_crash( char const* condition );
|
||||
void process_exit( u32 code );
|
||||
|
||||
#if Build_Debug
|
||||
#define fatal( fmt, ... ) \
|
||||
do \
|
||||
{ \
|
||||
local_persist thread_local \
|
||||
char buf[GEN_PRINTF_MAXLEN] = { 0 }; \
|
||||
\
|
||||
str_fmt(buf, GEN_PRINTF_MAXLEN, fmt, __VA_ARGS__); \
|
||||
GEN_PANIC(buf); \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
|
||||
# define fatal( fmt, ... ) \
|
||||
do \
|
||||
{ \
|
||||
str_fmt_out_err_va( fmt, __VA_ARGS__ ); \
|
||||
process_exit(1); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
#pragma endregion Debug
|
||||
|
||||
|
Reference in New Issue
Block a user