From c404fae203e9670cebef3f65051794f86419bdb9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 31 Oct 2013 17:22:42 +0000 Subject: [PATCH 5/7] logger: don't change ABI with --disable-debug Rather than having functions magically disappear, it seems much easier to have those functions exist but do nothing. One day I'll remove ENABLE_DEBUG altogether, but until then... --- telepathy-logger/debug-internal.h | 16 ---------------- telepathy-logger/debug.c | 6 ++---- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/telepathy-logger/debug-internal.h b/telepathy-logger/debug-internal.h index 8d39bcc..66e6178 100644 --- a/telepathy-logger/debug-internal.h +++ b/telepathy-logger/debug-internal.h @@ -28,8 +28,6 @@ #include #include -#ifdef ENABLE_DEBUG - G_BEGIN_DECLS typedef enum @@ -97,18 +95,4 @@ G_STMT_START { \ #endif /* DEBUG_FLAG */ -#else /* ENABLE_DEBUG */ - -#ifdef DEBUG_FLAG - -#define DEBUG(format, ...) G_STMT_START { } G_STMT_END -#define DEBUGGING 0 -#define PATH_DEBUG(chan, format, ...) G_STMT_START { } G_STMT_END - -#endif /* DEBUG_FLAG */ - -#define _tpl_debug_free() G_STMT_START { } G_STMT_END - -#endif /* ENABLE_DEBUG */ - #endif /* __TPL_DEBUG_H__ */ diff --git a/telepathy-logger/debug.c b/telepathy-logger/debug.c index 7b38564..e25b6ba 100644 --- a/telepathy-logger/debug.c +++ b/telepathy-logger/debug.c @@ -23,8 +23,6 @@ #include -#ifdef ENABLE_DEBUG - static TplDebugFlags flags = 0; static GDebugKey keys[] = { @@ -90,6 +88,7 @@ void _tpl_debug (TplDebugFlags flag, const gchar *format, ...) { +#ifdef ENABLE_DEBUG gchar *message; va_list args; @@ -101,10 +100,9 @@ void _tpl_debug (TplDebugFlags flag, g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s", message); g_free (message); +#endif } -#endif /* ENABLE_DEBUG */ - /* The following function has to be always define or CRITICAL messages won't * be shown */ -- 1.8.4.rc3