From cc07f45b461e763e3d250262280272165c8d91e8 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 26 May 2015 15:00:50 -0600 Subject: [PATCH] inttypes: force correct mingw PRIdMAX even without The mingw trick of using __USE_MINGW_ANSI_STDIO only changes the definitions in if is also included. But since we want to always use the __gnu_printf__ flavor when available, we want to make sure that including 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 . Signed-off-by: Eric Blake --- ChangeLog | 5 +++++ lib/inttypes.in.h | 4 ++++ modules/inttypes | 1 + 3 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index a204cacabf..e96045b6c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2015-05-26 Eric Blake + inttypes: force correct mingw PRIdMAX even without + * modules/inttypes (Depends-on): Require extensions, so that mingw + always uses GNU style inttypes. + * lib/inttypes.in.h: On mingw, include . + 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. diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index 13a72bee90..78846f6968 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -51,6 +51,10 @@ #endif /* Get CHAR_BIT. */ #include +/* On mingw, __USE_MINGW_ANSI_STDIO only works if is also included */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +#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 ." diff --git a/modules/inttypes b/modules/inttypes index 157b59791a..6d2b875df3 100644 --- a/modules/inttypes +++ b/modules/inttypes @@ -6,6 +6,7 @@ m4/inttypes-pri.m4 Depends-on: inttypes-incomplete +extensions configure.ac: gl_INTTYPES_H -- 2.39.5