fix: if NDEBUG is defined debug macros will be empty
parent
bb6dcbeabe
commit
2021092a17
16
debug.h
16
debug.h
|
@ -11,6 +11,20 @@
|
|||
extern int g_debug_error_abort;
|
||||
extern int g_debug_log_lvl;
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
#define LOG_INFO(...)
|
||||
#define LOG_ERROR(...)
|
||||
#define LOG_WARNING(...)
|
||||
#define RETURN_ERROR(...)
|
||||
#define RETURN_WARNING(...)
|
||||
#define ASSERT_RETURN(...)
|
||||
#define CHECK(...)
|
||||
#define ASSERT_RETURN_WARN(...)
|
||||
#define UNREACHABLE(...)
|
||||
|
||||
#else
|
||||
|
||||
#define LOG_INFO(...) do {\
|
||||
if(g_debug_log_lvl < 3) break;\
|
||||
printf("[%s:%d] INFO | ", __FILE__, __LINE__);\
|
||||
|
@ -71,4 +85,6 @@ extern int g_debug_log_lvl;
|
|||
abort();\
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !CUTES_DEBUG_H
|
||||
|
|
Loading…
Reference in New Issue