redmine

Added "unlikely()" to critical_on() and error_on()

Showing 1 changed file with 2 additions and 2 deletions
... ... @@ -30,11 +30,11 @@
extern void _critical( const char *const function_name, const char *fmt, ...);
#define critical(...) _critical(__FUNCTION__, __VA_ARGS__)
#define critical_on(cond) {if (cond) {critical("Assert: "TOSTR(cond));}}
#define critical_on(cond) {if (unlikely(cond)) {critical("Assert: "TOSTR(cond));}}
extern void _error(const char *const function_name, const char *fmt, ...);
#define error(...) _error(__FUNCTION__, __VA_ARGS__)
#define error_on(cond) {if (cond) {error("Error: ("TOSTR(cond)") != 0");}}
#define error_on(cond) {if (unlikely(cond)) {error("Error: ("TOSTR(cond)") != 0");}}
extern void _warning(const char *const function_name, const char *fmt, ...);
#define warning(...) _warning(__FUNCTION__, __VA_ARGS__)
... ...