]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
build: handle printf style format in mingw
authorAlon Bar-Lev <alon.barlev@gmail.com>
Wed, 29 Feb 2012 20:11:43 +0000 (22:11 +0200)
committerDavid Sommerseth <davids@redhat.com>
Thu, 22 Mar 2012 21:06:52 +0000 (22:06 +0100)
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
buffer.h
error.h
misc.h
status.h

index 6c79007f4fabc8b0f08306e11ea3ab9942e486d7..9bc33dba22fb2c580765b3f15766fc4d3583d835 100644 (file)
--- a/buffer.h
+++ b/buffer.h
@@ -312,7 +312,11 @@ has_digit (const unsigned char* src)
  */
 bool buf_printf (struct buffer *buf, const char *format, ...)
 #ifdef __GNUC__
-    __attribute__ ((format (printf, 2, 3)))
+#if __USE_MINGW_ANSI_STDIO
+       __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+       __attribute__ ((format (__printf__, 2, 3)))
+#endif
 #endif
     ;
 
@@ -326,7 +330,11 @@ bool buf_puts (struct buffer *buf, const char *str);
  */
 bool openvpn_snprintf(char *str, size_t size, const char *format, ...)
 #ifdef __GNUC__
-    __attribute__ ((format (printf, 3, 4)))
+#if __USE_MINGW_ANSI_STDIO
+       __attribute__ ((format (gnu_printf, 3, 4)))
+#else
+       __attribute__ ((format (__printf__, 3, 4)))
+#endif
 #endif
     ;
 
diff --git a/error.h b/error.h
index aafd0557b78fd703b7aa082391a5de7db7da9634..d2c04b0e3c0d7d9a2b7f025209f052bca91f6fff 100644 (file)
--- a/error.h
+++ b/error.h
@@ -178,7 +178,11 @@ bool dont_mute (unsigned int flags); /* check muting filter */
 
 void x_msg (const unsigned int flags, const char *format, ...)
 #ifdef __GNUC__
-    __attribute__ ((format (printf, 2, 3)))
+#if __USE_MINGW_ANSI_STDIO
+       __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+       __attribute__ ((format (__printf__, 2, 3)))
+#endif
 #endif
     ; /* should be called via msg above */
 
diff --git a/misc.h b/misc.h
index dd6bd5ac5eb2f89ad79c3a0b7c06878f65220ec6..a9548c57cbc00c652fb179a61f9595fe58d8dc40 100644 (file)
--- a/misc.h
+++ b/misc.h
@@ -435,13 +435,21 @@ void argv_printf_arglist (struct argv *a, const char *format, const unsigned int
 
 void argv_printf (struct argv *a, const char *format, ...)
 #ifdef __GNUC__
-  __attribute__ ((format (printf, 2, 3)))
+#if __USE_MINGW_ANSI_STDIO
+       __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+       __attribute__ ((format (__printf__, 2, 3)))
+#endif
 #endif
   ;
 
 void argv_printf_cat (struct argv *a, const char *format, ...)
 #ifdef __GNUC__
-  __attribute__ ((format (printf, 2, 3)))
+#if __USE_MINGW_ANSI_STDIO
+       __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+       __attribute__ ((format (__printf__, 2, 3)))
+#endif
 #endif
   ;
 
index 0bdad4e549a70b536b89f6b2a2a2896cde76a160..af16fd2a1451fc61559561f2c2ecd7990b8e71dd 100644 (file)
--- a/status.h
+++ b/status.h
@@ -77,7 +77,11 @@ void status_flush (struct status_output *so);
 bool status_close (struct status_output *so);
 void status_printf (struct status_output *so, const char *format, ...)
 #ifdef __GNUC__
-    __attribute__ ((format (printf, 2, 3)))
+#if __USE_MINGW_ANSI_STDIO
+       __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+       __attribute__ ((format (__printf__, 2, 3)))
+#endif
 #endif
     ;