From f62b92f399e5dfbcaa1e98d372c5bec6798eb62f Mon Sep 17 00:00:00 2001 From: Hyunjee Kim Date: Thu, 7 Sep 2017 11:08:32 +0900 Subject: [PATCH] [i18ninfo] Fix MACRO error - PRINT_DEBUG_LOG Change-Id: I65acd4a0be725afa71c61c699d2506e17d68854e Signed-off-by: Hyunjee Kim --- i18ninfo/i18ninfo.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/i18ninfo/i18ninfo.cpp b/i18ninfo/i18ninfo.cpp index aa418d9..cdda84b 100644 --- a/i18ninfo/i18ninfo.cpp +++ b/i18ninfo/i18ninfo.cpp @@ -16,14 +16,10 @@ static int ASCIIDOC_FLAG = 0; #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); \ -- 2.7.4