Commit 6a12bd7a authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Wrap LOG and DBG in do { ... } while(0)

PUBLISHED_FROM=c4f3d44ed16dba60db3198b90478c1b2e6f2a5c1
parent b39e30fb
......@@ -209,18 +209,22 @@ void cs_log_print_prefix(const char *func);
void cs_log_printf(const char *fmt, ...);
#define LOG(l, x) \
do { \
if (cs_log_level >= l) { \
cs_log_print_prefix(__func__); \
cs_log_printf x; \
}
} \
} while (0)
#ifndef CS_NDEBUG
#define DBG(x) \
do { \
if (cs_log_level >= LL_VERBOSE_DEBUG) { \
cs_log_print_prefix(__func__); \
cs_log_printf x; \
}
} \
} while (0)
#else /* NDEBUG */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment