Added continue related error macros. Also added a new type where you can put commands before continuing.

This commit is contained in:
Relintai 2022-02-04 22:02:54 +01:00
parent ac66ecd84a
commit 60ed46b5e6

View File

@ -95,6 +95,36 @@
} else\
((void)0)\
#define ERR_CONTINUE(cond) \
if (cond) {\
Logger::_log_error(__FUNCTION__, __FILE__, __LINE__, "ERR_CONTINUE: \"" #cond "\" is true!"); \
continue;\
} else\
((void)0)\
#define ERR_CONTINUE_MSG(cond, msg) \
if (cond) {\
Logger::_log_error(__FUNCTION__, __FILE__, __LINE__, msg); \
continue;\
} else\
((void)0)\
#define ERR_CONTINUE_ACTION(cond, action) \
if (cond) {\
Logger::_log_error(__FUNCTION__, __FILE__, __LINE__, "ERR_CONTINUE: \"" #cond "\" is true!"); \
action;\
continue;\
} else\
((void)0)\
#define ERR_CONTINUE_ACTION_MSG(cond, action, msg) \
if (cond) {\
Logger::_log_error(__FUNCTION__, __FILE__, __LINE__, msg); \
action;\
continue;\
} else\
((void)0)\
#define CRASH_INDEX(index, size) \
if ((index < 0) || (index >= size)) {\
Logger::_log_index_error(__FUNCTION__, __FILE__, __LINE__, index, size, "CRASH!"); \