fix: if NDEBUG is defined debug macros will be empty

main
Sara 2024-09-24 15:26:08 +02:00
parent bb6dcbeabe
commit 2021092a17
1 changed files with 16 additions and 0 deletions

16
debug.h
View File

@ -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