From: Hyunjee Kim Date: Thu, 7 Sep 2017 02:08:32 +0000 (+0900) Subject: [i18ninfo] Fix MACRO error X-Git-Tag: accepted/tizen/unified/20171117.060138~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f62b92f399e5dfbcaa1e98d372c5bec6798eb62f;p=platform%2Fcore%2Fapi%2Fbase-utils.git [i18ninfo] Fix MACRO error - PRINT_DEBUG_LOG Change-Id: I65acd4a0be725afa71c61c699d2506e17d68854e Signed-off-by: Hyunjee Kim --- 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); \