From ac4d1b7f0e56f8f9fa92271a8b48c6edbc808a30 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 31 Jan 2014 11:52:15 +0000 Subject: [PATCH] agent: Fix inlining of nice_debug() if NDEBUG is defined --- agent/agent-priv.h | 4 ++-- agent/debug.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/agent/agent-priv.h b/agent/agent-priv.h index a49d9a5..1745c12 100644 --- a/agent/agent-priv.h +++ b/agent/agent-priv.h @@ -236,8 +236,8 @@ void nice_debug_init (void); #ifdef NDEBUG -static inline gboolean nice_debug_is_enabled (void) { return FALSE }; -static inline void nice_debug (const char *fmt, ...) G_GNUC_PRINTF (1, 2) { } +static inline gboolean nice_debug_is_enabled (void) { return FALSE; } +static inline void nice_debug (const char *fmt, ...) { } #else gboolean nice_debug_is_enabled (void); void nice_debug (const char *fmt, ...) G_GNUC_PRINTF (1, 2); diff --git a/agent/debug.c b/agent/debug.c index bd8ce84..ce223f1 100644 --- a/agent/debug.c +++ b/agent/debug.c @@ -93,10 +93,14 @@ void nice_debug_init (void) } } +#ifndef NDEBUG gboolean nice_debug_is_enabled (void) { return debug_enabled; } +#else +/* Defined in agent-priv.h. */ +#endif void nice_debug_enable (gboolean with_stun) { @@ -113,6 +117,7 @@ void nice_debug_disable (gboolean with_stun) stun_debug_disable (); } +#ifndef NDEBUG void nice_debug (const char *fmt, ...) { va_list ap; @@ -122,3 +127,6 @@ void nice_debug (const char *fmt, ...) va_end (ap); } } +#else +/* Defined in agent-priv.h. */ +#endif -- 2.7.4