diff th_network.h @ 577:70d44ba005ac

Define a helper macro for __attribute__ ((__format__ (__printf__, 2, 3))) TH_ATTR_PRINTF_FMT(2, 3) and use it, conditionally using a stub for MINGW64 to avoid "useless" warnings.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 09 Jan 2020 18:27:48 +0200
parents 262411458cde
children 3c9205d52376
line wrap: on
line diff
--- a/th_network.h	Thu Jan 09 18:17:48 2020 +0200
+++ b/th_network.h	Thu Jan 09 18:27:48 2020 +0200
@@ -10,9 +10,8 @@
 
 #include <stdio.h>
 #include <unistd.h>
-#include "th_types.h"
+#include "th_util.h"
 #include "th_datastruct.h"
-#include "th_util.h"
 
 
 #ifdef TH_PLAT_WINDOWS
@@ -142,9 +141,9 @@
     ssize_t bufsize);
 
 void        th_conn_err(th_conn_t *conn, int err, const char *fmt, ...)
-            __attribute__ ((__format__ (__printf__, 3, 4)));
+            TH_ATTR_PRINTF_FMT(3, 4);
 void        th_conn_msg(th_conn_t *conn, int loglevel, const char *fmt, ...)
-            __attribute__ ((__format__ (__printf__, 3, 4)));
+            TH_ATTR_PRINTF_FMT(3, 4);
 
 int         th_conn_set_proxy(th_conn_t *conn, int type, int port, const char *host, int auth_type);
 int         th_conn_set_proxy_mode(th_conn_t *conn, const int mode);