]> Savannah Git Hosting - gnulib.git/commitdiff
inttypes: force correct mingw PRIdMAX even without <stdio.h>
authorEric Blake <eblake@redhat.com>
Tue, 26 May 2015 21:00:50 +0000 (15:00 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 26 May 2015 21:00:50 +0000 (15:00 -0600)
The mingw trick of using __USE_MINGW_ANSI_STDIO only changes the
definitions in <inttypes.h> if <stdio.h> is also included.  But
since we want to always use the __gnu_printf__ flavor when
available, we want to make sure that including <inttypes.h> in
isolation will give the desired "lld" answer.

Reported by Assaf Gordon.

* modules/inttypes (Depends-on): Require extensions, so that mingw
always uses GNU style inttypes.
* lib/inttypes.in.h: On mingw, include <stdio.h>.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/inttypes.in.h
modules/inttypes

index a204cacabf5d3fe4e4700e198ac571368ec0c5d4..e96045b6c8e5256fe528004df6db26900b44d640 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-05-26  Eric Blake  <eblake@redhat.com>
 
+       inttypes: force correct mingw PRIdMAX even without <stdio.h>
+       * modules/inttypes (Depends-on): Require extensions, so that mingw
+       always uses GNU style inttypes.
+       * lib/inttypes.in.h: On mingw, include <stdio.h>.
+
        stdio: fix probe on mingw under gcc 5.1
        * m4/stdio_h.m4 (gl_STDIO_H): Change to compile test, to work
        around new gcc preprocessor rules.
index 13a72bee90c9623f28a03f6228108690d8e6ed0e..78846f696839df88118cf05ac559c262496a83d4 100644 (file)
 #endif
 /* Get CHAR_BIT.  */
 #include <limits.h>
+/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# include <stdio.h>
+#endif
 
 #if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
 # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
index 157b59791ab6fd15d24ee01cc44325ca129d7c3b..6d2b875df3246961a7d47a09bb9177fd33029190 100644 (file)
@@ -6,6 +6,7 @@ m4/inttypes-pri.m4
 
 Depends-on:
 inttypes-incomplete
+extensions
 
 configure.ac:
 gl_INTTYPES_H