summaryrefslogtreecommitdiff
path: root/stun
diff options
context:
space:
mode:
Diffstat (limited to 'stun')
-rw-r--r--stun/debug.c9
-rw-r--r--stun/debug.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/stun/debug.c b/stun/debug.c
index 3d579db..2b4ec59 100644
--- a/stun/debug.c
+++ b/stun/debug.c
@@ -55,6 +55,15 @@ void stun_debug_disable (void) {
debug_enabled = 0;
}
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define GNUC_PRINTF(format_idx, arg_idx) \
+ __attribute__((__format__ (__printf__, format_idx, arg_idx)))
+#else
+#define GNUC_PRINTF( format_idx, arg_idx)
+#endif
+
+static void
+default_handler (const char *format, va_list ap) GNUC_PRINTF (1, 0);
static void
default_handler (const char *format, va_list ap)
diff --git a/stun/debug.h b/stun/debug.h
index d4884d5..47a6114 100644
--- a/stun/debug.h
+++ b/stun/debug.h
@@ -66,7 +66,12 @@ void stun_debug_disable (void);
*
* Callback for a debug message from the STUN code.
*/
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
+typedef void (*StunDebugHandler) (const char *format, va_list ap)
+ __attribute__((__format__ (__printf__, 1, 0)));
+#else
typedef void (*StunDebugHandler) (const char *format, va_list ap);
+#endif
/**
* stun_set_debug_handler: