#define MS_TO_MIN 60000
#define MS_TO_HOUR 3600000
-#define PRINT_ERROR_LOG(func_name, error_code) if (DEBUG_FLAG) { \
- fprintf(stderr, "\033[0;31m%s failed! Error: %s [code: %d] \033[0m\n", \
- func_name, get_error_message(error_code), error_code); \
- }
+#define PRINT_ERROR_LOG(func_name, error_code) ({ fprintf(stderr, "\033[0;31m%s failed! Error: %s [code: %d] \033[0m\n", \
+ func_name, get_error_message(error_code), error_code); })
-#define PRINT_DEBUG_LOG(fmt, arg...) if (DEBUG_FLAG) { do {\
- fprintf(stdout, "\033[0;32m" fmt "\033[1;32m \033[0m", ##arg); } while (0); \
- }
+#define PRINT_DEBUG_LOG(fmt, arg...) ((DEBUG_FLAG) ? fprintf(stdout, "\033[0;32m" fmt "\033[1;32m \033[0m", ##arg) : 0 )
#define CHECK_ERROR(fun_name, error_code) if (error_code != 0) { \
PRINT_ERROR_LOG(fun_name, error_code); \