diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-02-02 21:38:20 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-07-10 16:00:54 +0400 |
commit | 3e00bbb3cb5c8f55c14000cd4834468fe7386a44 (patch) | |
tree | 762ca66d604b572c049dfca0f605a77b59d31242 | |
parent | 5db3c6de68b5ff6425b1e3abd3968f248b7c35d7 (diff) | |
download | dctrl-tools-3e00bbb3cb5c8f55c14000cd4834468fe7386a44.tar.gz |
make debug() and debug_message() empty macros ifndef INCLUDE_DEBUG_MSGS
-rw-r--r-- | lib/msg.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -110,21 +110,23 @@ message (int severity, const char * fname, const char * fmt, ...) #undef PROGNAME_MAXLEN #endif +#ifdef INCLUDE_DEBUG_MSGS inline static void debug_message (const char * s, const char * fname) { -#ifdef INCLUDE_DEBUG_MSGS message (L_DEBUG, fname, "%s", s); -#endif } +#else +#define debug_message(x, y) /* nothing */ +#endif + +#ifdef INCLUDE_DEBUG_MSGS static void debug(const char * s, ...) __attribute__((format(printf, 1, 2))); - inline static void debug(const char * s, ...) { -#ifdef INCLUDE_DEBUG_MSGS if (do_msg(L_DEBUG)) { va_list va; va_start(va, s); @@ -133,8 +135,10 @@ debug(const char * s, ...) fprintf(stderr, "\n"); va_end(va); } -#endif } +#else +#define debug(s, ...) /* nothing */ +#endif inline static void errno_msg(int severity, char const * fname) |