summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-02-02 21:38:20 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-07-10 16:00:54 +0400
commit3e00bbb3cb5c8f55c14000cd4834468fe7386a44 (patch)
tree762ca66d604b572c049dfca0f605a77b59d31242
parent5db3c6de68b5ff6425b1e3abd3968f248b7c35d7 (diff)
downloaddctrl-tools-3e00bbb3cb5c8f55c14000cd4834468fe7386a44.tar.gz
make debug() and debug_message() empty macros ifndef INCLUDE_DEBUG_MSGS
-rw-r--r--lib/msg.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/msg.h b/lib/msg.h
index cfabc7f..d70798c 100644
--- a/lib/msg.h
+++ b/lib/msg.h
@@ -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)