From 89e8990d628cd874ae16563b96d8ca71b5070a02 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 15 Nov 2011 08:37:35 +0200 Subject: [PATCH] tls: replace debug functions with macros Unfortunately g_string_append_vprintf() requires glib-2.0 >= 2.14 and we only mandate glib-2.0 >= 2.12. This should fix the build error on RHEL/CentOS5. --- src/core/sipe-tls.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/core/sipe-tls.c b/src/core/sipe-tls.c index 9078d67c..835640d3 100644 --- a/src/core/sipe-tls.c +++ b/src/core/sipe-tls.c @@ -93,29 +93,10 @@ static void debug_hex(struct tls_internal_state *state) g_string_append(str, "\n"); } -static void debug_print(struct tls_internal_state *state, - const gchar *string) -{ - if (state->debug) - g_string_append(state->debug, string); -} - -static void debug_printf(struct tls_internal_state *state, - const gchar *format, - ...) G_GNUC_PRINTF(2, 3); -static void debug_printf(struct tls_internal_state *state, - const gchar *format, - ...) -{ - va_list ap; - - if (!state->debug) return; - - va_start(ap, format); - g_string_append_vprintf(state->debug, format, ap); - va_end(ap); -} - +#define debug_print(state, string) \ + if (state->debug) g_string_append(state->debug, string) +#define debug_printf(state, format, ...) \ + if (state->debug) g_string_append_printf(state->debug, format, __VA_ARGS__) /* * TLS message parsing -- 2.11.4.GIT