summaryrefslogtreecommitdiff
path: root/stun
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2013-12-17 10:05:17 +0000
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-01-02 13:43:36 -0500
commit0d2943b3bef98fa3bd0abafb3e8795694dcfc579 (patch)
tree17e2265f8bb7ea5fe82aea0fbed58a59c6d468e6 /stun
parentb80a67d51dc991140e263ed6b8e3de3cb01fbd52 (diff)
downloadlibnice-0d2943b3bef98fa3bd0abafb3e8795694dcfc579.tar.gz
stun: Add printf function attribute
This shuts a compiler warning up and allows for format string checking of debug messages.
Diffstat (limited to 'stun')
-rw-r--r--stun/debug.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/stun/debug.h b/stun/debug.h
index 726397b..7396f88 100644
--- a/stun/debug.h
+++ b/stun/debug.h
@@ -37,6 +37,8 @@
#ifndef STUN_DEBUG_H
#define STUN_DEBUG_H
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -57,7 +59,12 @@ void stun_debug_enable (void);
void stun_debug_disable (void);
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
+void stun_debug (const char *fmt, ...)
+ __attribute__((__format__ (__printf__, 1, 2)));
+#else
void stun_debug (const char *fmt, ...);
+#endif
void stun_debug_bytes (const void *data, size_t len);