inttypes.h: Take into account __USE_MINGW_ANSI_STDIO and msvcrt version instead of depending on _mingw_print_p*.h headers. Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-headers/configure b/mingw-w64-headers/configure index 36f56ec..0af98e1 100755 --- a/mingw-w64-headers/configure +++ b/mingw-w64-headers/configure
@@ -2648,7 +2648,7 @@ # Checks for header files. -BASEHEAD_LIST="crt/_bsd_types.h crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/_timeval.h crt/crtdefs.h crt/excpt.h crt/intrin.h crt/vadefs.h crt/tchar.h "$srcdir/include/*.h +BASEHEAD_LIST="crt/_bsd_types.h crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/_timeval.h crt/crtdefs.h crt/excpt.h crt/intrin.h crt/vadefs.h crt/tchar.h "$srcdir/include/*.h SECHEAD_LIST="$srcdir/crt/sec_api/stralign_s.h" for i in c dlg h16 hxx rh ver; do BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i
diff --git a/mingw-w64-headers/configure.ac b/mingw-w64-headers/configure.ac index d83037e..dda8a62 100644 --- a/mingw-w64-headers/configure.ac +++ b/mingw-w64-headers/configure.ac
@@ -39,7 +39,7 @@ # Checks for header files. -BASEHEAD_LIST="crt/_bsd_types.h crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/_timeval.h crt/crtdefs.h crt/excpt.h crt/intrin.h crt/vadefs.h crt/tchar.h "$srcdir/include/*.h +BASEHEAD_LIST="crt/_bsd_types.h crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/_timeval.h crt/crtdefs.h crt/excpt.h crt/intrin.h crt/vadefs.h crt/tchar.h "$srcdir/include/*.h SECHEAD_LIST="$srcdir/crt/sec_api/stralign_s.h" for i in c dlg h16 hxx rh ver; do BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i
diff --git a/mingw-w64-headers/crt/_mingw_print_pop.h b/mingw-w64-headers/crt/_mingw_print_pop.h deleted file mode 100644 index 046b620..0000000 --- a/mingw-w64-headers/crt/_mingw_print_pop.h +++ /dev/null
@@ -1,136 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ - -/* Define __mingw_<printf> macros. */ -#if defined(__USE_MINGW_ANSI_STDIO) && (defined(_INC_STDIO) || defined(_WSTDIO_DEFINED)) && ((__USE_MINGW_ANSI_STDIO + 0) != 0) - -/* Redefine to GNU specific PRI... and SCN... macros. */ -#if defined(_INTTYPES_H_) && defined(PRId64) -#undef PRId64 -#undef PRIdLEAST64 -#undef PRIdFAST64 -#undef PRIdMAX -#undef PRIi64 -#undef PRIiLEAST64 -#undef PRIiFAST64 -#undef PRIiMAX -#undef PRIo64 -#undef PRIoLEAST64 -#undef PRIoFAST64 -#undef PRIoMAX -#undef PRIu64 -#undef PRIuLEAST64 -#undef PRIuFAST64 -#undef PRIuMAX -#undef PRIx64 -#undef PRIxLEAST64 -#undef PRIxFAST64 -#undef PRIxMAX -#undef PRIX64 -#undef PRIXLEAST64 -#undef PRIXFAST64 -#undef PRIXMAX - -#undef SCNd64 -#undef SCNdLEAST64 -#undef SCNdFAST64 -#undef SCNdMAX -#undef SCNi64 -#undef SCNiLEAST64 -#undef SCNiFAST64 -#undef SCNiMAX -#undef SCNo64 -#undef SCNoLEAST64 -#undef SCNoFAST64 -#undef SCNoMAX -#undef SCNx64 -#undef SCNxLEAST64 -#undef SCNxFAST64 -#undef SCNxMAX -#undef SCNu64 -#undef SCNuLEAST64 -#undef SCNuFAST64 -#undef SCNuMAX - -#ifdef _WIN64 -#undef PRIdPTR -#undef PRIiPTR -#undef PRIoPTR -#undef PRIuPTR -#undef PRIxPTR -#undef PRIXPTR - -#undef SCNdPTR -#undef SCNiPTR -#undef SCNoPTR -#undef SCNxPTR -#undef SCNuPTR - -#endif /* _WIN64 */ - -#define PRId64 "lld" -#define PRIdLEAST64 "lld" -#define PRIdFAST64 "lld" -#define PRIdMAX "lld" -#define PRIi64 "lli" -#define PRIiLEAST64 "lli" -#define PRIiFAST64 "lli" -#define PRIiMAX "lli" -#define PRIo64 "llo" -#define PRIoLEAST64 "llo" -#define PRIoFAST64 "llo" -#define PRIoMAX "llo" -#define PRIu64 "llu" -#define PRIuLEAST64 "llu" -#define PRIuFAST64 "llu" -#define PRIuMAX "llu" -#define PRIx64 "llx" -#define PRIxLEAST64 "llx" -#define PRIxFAST64 "llx" -#define PRIxMAX "llx" -#define PRIX64 "llX" -#define PRIXLEAST64 "llX" -#define PRIXFAST64 "llX" -#define PRIXMAX "llX" - -#define SCNd64 "lld" -#define SCNdLEAST64 "lld" -#define SCNdFAST64 "lld" -#define SCNdMAX "lld" -#define SCNi64 "lli" -#define SCNiLEAST64 "lli" -#define SCNiFAST64 "lli" -#define SCNiMAX "lli" -#define SCNo64 "llo" -#define SCNoLEAST64 "llo" -#define SCNoFAST64 "llo" -#define SCNoMAX "llo" -#define SCNx64 "llx" -#define SCNxLEAST64 "llx" -#define SCNxFAST64 "llx" -#define SCNxMAX "llx" -#define SCNu64 "llu" -#define SCNuLEAST64 "llu" -#define SCNuFAST64 "llu" -#define SCNuMAX "llu" - -#ifdef _WIN64 -#define PRIdPTR "lld" -#define PRIiPTR "lli" -#define PRIoPTR "llo" -#define PRIuPTR "llu" -#define PRIxPTR "llx" -#define PRIXPTR "llX" - -#define SCNdPTR "lld" -#define SCNiPTR "lli" -#define SCNoPTR "llo" -#define SCNxPTR "llx" -#define SCNuPTR "llu" -#endif /* _WIN64 */ -#endif /* defined(_INTTYPES_H_) && defined(PRId64) */ - -#endif /* defined(__USE_MINGW_ANSI_STDIO) && defined(_INC_STDIO) && __USE_MINGW_ANSI_STDIO != 0 */
diff --git a/mingw-w64-headers/crt/_mingw_print_push.h b/mingw-w64-headers/crt/_mingw_print_push.h deleted file mode 100644 index e0da9d0..0000000 --- a/mingw-w64-headers/crt/_mingw_print_push.h +++ /dev/null
@@ -1,136 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ - -/* Undefine __mingw_<printf> macros. */ -#if defined(__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0) - -/* Redefine to MS specific PRI... and SCN... macros. */ -#if defined(_INTTYPES_H_) && defined(PRId64) -#undef PRId64 -#undef PRIdLEAST64 -#undef PRIdFAST64 -#undef PRIdMAX -#undef PRIi64 -#undef PRIiLEAST64 -#undef PRIiFAST64 -#undef PRIiMAX -#undef PRIo64 -#undef PRIoLEAST64 -#undef PRIoFAST64 -#undef PRIoMAX -#undef PRIu64 -#undef PRIuLEAST64 -#undef PRIuFAST64 -#undef PRIuMAX -#undef PRIx64 -#undef PRIxLEAST64 -#undef PRIxFAST64 -#undef PRIxMAX -#undef PRIX64 -#undef PRIXLEAST64 -#undef PRIXFAST64 -#undef PRIXMAX - -#undef SCNd64 -#undef SCNdLEAST64 -#undef SCNdFAST64 -#undef SCNdMAX -#undef SCNi64 -#undef SCNiLEAST64 -#undef SCNiFAST64 -#undef SCNiMAX -#undef SCNo64 -#undef SCNoLEAST64 -#undef SCNoFAST64 -#undef SCNoMAX -#undef SCNx64 -#undef SCNxLEAST64 -#undef SCNxFAST64 -#undef SCNxMAX -#undef SCNu64 -#undef SCNuLEAST64 -#undef SCNuFAST64 -#undef SCNuMAX - -#ifdef _WIN64 -#undef PRIdPTR -#undef PRIiPTR -#undef PRIoPTR -#undef PRIuPTR -#undef PRIxPTR -#undef PRIXPTR - -#undef SCNdPTR -#undef SCNiPTR -#undef SCNoPTR -#undef SCNxPTR -#undef SCNuPTR -#endif /* _WIN64 */ - -#define PRId64 "lld" -#define PRIdLEAST64 "lld" -#define PRIdFAST64 "lld" -#define PRIdMAX "lld" -#define PRIi64 "lli" -#define PRIiLEAST64 "lli" -#define PRIiFAST64 "lli" -#define PRIiMAX "lli" -#define PRIo64 "llo" -#define PRIoLEAST64 "llo" -#define PRIoFAST64 "llo" -#define PRIoMAX "llo" -#define PRIu64 "llu" -#define PRIuLEAST64 "llu" -#define PRIuFAST64 "llu" -#define PRIuMAX "llu" -#define PRIx64 "llx" -#define PRIxLEAST64 "llx" -#define PRIxFAST64 "llx" -#define PRIxMAX "llx" -#define PRIX64 "llX" -#define PRIXLEAST64 "llX" -#define PRIXFAST64 "llX" -#define PRIXMAX "llX" - -#define SCNd64 "lld" -#define SCNdLEAST64 "lld" -#define SCNdFAST64 "lld" -#define SCNdMAX "lld" -#define SCNi64 "lli" -#define SCNiLEAST64 "lli" -#define SCNiFAST64 "lli" -#define SCNiMAX "lli" -#define SCNo64 "llo" -#define SCNoLEAST64 "llo" -#define SCNoFAST64 "llo" -#define SCNoMAX "llo" -#define SCNx64 "llx" -#define SCNxLEAST64 "llx" -#define SCNxFAST64 "llx" -#define SCNxMAX "llx" -#define SCNu64 "llu" -#define SCNuLEAST64 "llu" -#define SCNuFAST64 "llu" -#define SCNuMAX "llu" - -#ifdef _WIN64 -#define PRIdPTR "lld" -#define PRIiPTR "lli" -#define PRIoPTR "llo" -#define PRIuPTR "llu" -#define PRIxPTR "llx" -#define PRIXPTR "llX" - -#define SCNdPTR "lld" -#define SCNiPTR "lli" -#define SCNoPTR "llo" -#define SCNxPTR "llx" -#define SCNuPTR "llu" -#endif /* _WIN64 */ - -#endif /* defined(_INTTYPES_H_) && defined(PRId64) */ - -#endif /* defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0 */
diff --git a/mingw-w64-headers/crt/inttypes.h b/mingw-w64-headers/crt/inttypes.h index a30bdac..500df7d 100644 --- a/mingw-w64-headers/crt/inttypes.h +++ b/mingw-w64-headers/crt/inttypes.h
@@ -22,11 +22,6 @@ intmax_t rem; } imaxdiv_t; -/* Restore to !define(__USE_MINGW_ANSI_STDIO) */ -#include <_mingw_print_push.h> - -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) - /* 7.8.1 Macros for format specifiers * * MS runtime does not yet understand C9x standard "ll" @@ -34,111 +29,120 @@ * The non-standard I64 length specifier causes warning in GCC, * but understood by MS runtime functions. */ +#if __MSVCRT_VERSION__ >= 0x1400 || (defined(__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0)) +#define PRId64 "lld" +#define PRIi64 "lli" +#define PRIo64 "llo" +#define PRIu64 "llu" +#define PRIx64 "llx" +#define PRIX64 "llX" +#else +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#endif /* fprintf macros for signed types */ #define PRId8 "d" #define PRId16 "d" #define PRId32 "d" -#define PRId64 "I64d" #define PRIdLEAST8 "d" #define PRIdLEAST16 "d" #define PRIdLEAST32 "d" -#define PRIdLEAST64 "I64d" +#define PRIdLEAST64 PRId64 #define PRIdFAST8 "d" #define PRIdFAST16 "d" #define PRIdFAST32 "d" -#define PRIdFAST64 "I64d" +#define PRIdFAST64 PRId64 -#define PRIdMAX "I64d" +#define PRIdMAX PRId64 #define PRIi8 "i" #define PRIi16 "i" #define PRIi32 "i" -#define PRIi64 "I64i" #define PRIiLEAST8 "i" #define PRIiLEAST16 "i" #define PRIiLEAST32 "i" -#define PRIiLEAST64 "I64i" +#define PRIiLEAST64 PRIi64 #define PRIiFAST8 "i" #define PRIiFAST16 "i" #define PRIiFAST32 "i" -#define PRIiFAST64 "I64i" +#define PRIiFAST64 PRIi64 -#define PRIiMAX "I64i" +#define PRIiMAX PRIi64 #define PRIo8 "o" #define PRIo16 "o" #define PRIo32 "o" -#define PRIo64 "I64o" #define PRIoLEAST8 "o" #define PRIoLEAST16 "o" #define PRIoLEAST32 "o" -#define PRIoLEAST64 "I64o" +#define PRIoLEAST64 PRIo64 #define PRIoFAST8 "o" #define PRIoFAST16 "o" #define PRIoFAST32 "o" -#define PRIoFAST64 "I64o" +#define PRIoFAST64 PRIo64 -#define PRIoMAX "I64o" +#define PRIoMAX PRIo64 /* fprintf macros for unsigned types */ #define PRIu8 "u" #define PRIu16 "u" #define PRIu32 "u" -#define PRIu64 "I64u" #define PRIuLEAST8 "u" #define PRIuLEAST16 "u" #define PRIuLEAST32 "u" -#define PRIuLEAST64 "I64u" +#define PRIuLEAST64 PRIu64 #define PRIuFAST8 "u" #define PRIuFAST16 "u" #define PRIuFAST32 "u" -#define PRIuFAST64 "I64u" +#define PRIuFAST64 PRIu64 -#define PRIuMAX "I64u" +#define PRIuMAX PRIu64 #define PRIx8 "x" #define PRIx16 "x" #define PRIx32 "x" -#define PRIx64 "I64x" #define PRIxLEAST8 "x" #define PRIxLEAST16 "x" #define PRIxLEAST32 "x" -#define PRIxLEAST64 "I64x" +#define PRIxLEAST64 PRIx64 #define PRIxFAST8 "x" #define PRIxFAST16 "x" #define PRIxFAST32 "x" -#define PRIxFAST64 "I64x" +#define PRIxFAST64 PRIx64 -#define PRIxMAX "I64x" +#define PRIxMAX PRIx64 #define PRIX8 "X" #define PRIX16 "X" #define PRIX32 "X" -#define PRIX64 "I64X" #define PRIXLEAST8 "X" #define PRIXLEAST16 "X" #define PRIXLEAST32 "X" -#define PRIXLEAST64 "I64X" +#define PRIXLEAST64 PRIX64 #define PRIXFAST8 "X" #define PRIXFAST16 "X" #define PRIXFAST32 "X" -#define PRIXFAST64 "I64X" +#define PRIXFAST64 PRIX64 -#define PRIXMAX "I64X" +#define PRIXMAX PRIX64 /* * fscanf macros for signed int types @@ -149,88 +153,88 @@ #define SCNd16 "hd" #define SCNd32 "d" -#define SCNd64 "I64d" +#define SCNd64 PRId64 #define SCNdLEAST16 "hd" #define SCNdLEAST32 "d" -#define SCNdLEAST64 "I64d" +#define SCNdLEAST64 PRId64 #define SCNdFAST16 "hd" #define SCNdFAST32 "d" -#define SCNdFAST64 "I64d" +#define SCNdFAST64 PRId64 -#define SCNdMAX "I64d" +#define SCNdMAX PRId64 #define SCNi16 "hi" #define SCNi32 "i" -#define SCNi64 "I64i" +#define SCNi64 PRIi64 #define SCNiLEAST16 "hi" #define SCNiLEAST32 "i" -#define SCNiLEAST64 "I64i" +#define SCNiLEAST64 PRIi64 #define SCNiFAST16 "hi" #define SCNiFAST32 "i" -#define SCNiFAST64 "I64i" +#define SCNiFAST64 PRIi64 -#define SCNiMAX "I64i" +#define SCNiMAX PRIi64 #define SCNo16 "ho" #define SCNo32 "o" -#define SCNo64 "I64o" +#define SCNo64 PRIo64 #define SCNoLEAST16 "ho" #define SCNoLEAST32 "o" -#define SCNoLEAST64 "I64o" +#define SCNoLEAST64 PRIo64 #define SCNoFAST16 "ho" #define SCNoFAST32 "o" -#define SCNoFAST64 "I64o" +#define SCNoFAST64 PRIo64 -#define SCNoMAX "I64o" +#define SCNoMAX PRIo64 #define SCNx16 "hx" #define SCNx32 "x" -#define SCNx64 "I64x" +#define SCNx64 PRIx64 #define SCNxLEAST16 "hx" #define SCNxLEAST32 "x" -#define SCNxLEAST64 "I64x" +#define SCNxLEAST64 PRIx64 #define SCNxFAST16 "hx" #define SCNxFAST32 "x" -#define SCNxFAST64 "I64x" +#define SCNxFAST64 PRIx64 -#define SCNxMAX "I64x" +#define SCNxMAX PRIx64 /* fscanf macros for unsigned int types */ #define SCNu16 "hu" #define SCNu32 "u" -#define SCNu64 "I64u" +#define SCNu64 PRIu64 #define SCNuLEAST16 "hu" #define SCNuLEAST32 "u" -#define SCNuLEAST64 "I64u" +#define SCNuLEAST64 PRIu64 #define SCNuFAST16 "hu" #define SCNuFAST32 "u" -#define SCNuFAST64 "I64u" +#define SCNuFAST64 PRIu64 -#define SCNuMAX "I64u" +#define SCNuMAX PRIu64 #ifdef _WIN64 -#define PRIdPTR "I64d" -#define PRIiPTR "I64i" -#define PRIoPTR "I64o" -#define PRIuPTR "I64u" -#define PRIxPTR "I64x" -#define PRIXPTR "I64X" -#define SCNdPTR "I64d" -#define SCNiPTR "I64i" -#define SCNoPTR "I64o" -#define SCNxPTR "I64x" -#define SCNuPTR "I64u" +#define PRIdPTR PRId64 +#define PRIiPTR PRIi64 +#define PRIoPTR PRIo64 +#define PRIuPTR PRIu64 +#define PRIxPTR PRIx64 +#define PRIXPTR PRIX64 +#define SCNdPTR PRId64 +#define SCNiPTR PRIi64 +#define SCNoPTR PRIo64 +#define SCNxPTR PRIx64 +#define SCNuPTR PRIu64 #else #define PRIdPTR "d" #define PRIiPTR "i" @@ -274,8 +278,6 @@ #define SCNuFAST8 "hhu" #endif /* __STDC_VERSION__ >= 199901 */ -#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ - intmax_t __cdecl imaxabs (intmax_t j); #ifndef __CRT__NO_INLINE __CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j) @@ -295,9 +297,6 @@ uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, int base); -/* Set PRI... and SCN... according to __USE_MINGW_ANSI_STDIO. */ -#include <_mingw_print_pop.h> - #ifdef __cplusplus } #endif
diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index d981f70..d065923 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h
@@ -8,8 +8,6 @@ #include <crtdefs.h> -#include <_mingw_print_push.h> - #pragma pack(push,_CRT_PACKING) #ifdef __cplusplus @@ -1399,6 +1397,4 @@ #include <sec_api/stdio_s.h> -#include <_mingw_print_pop.h> - #endif
diff --git a/mingw-w64-headers/crt/wchar.h b/mingw-w64-headers/crt/wchar.h index ce041ad..3b79a89 100644 --- a/mingw-w64-headers/crt/wchar.h +++ b/mingw-w64-headers/crt/wchar.h
@@ -7,7 +7,6 @@ #define _INC_WCHAR #include <crtdefs.h> -#include <_mingw_print_push.h> #if defined (__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0) && !defined (__USE_MINGW_STRTOX) #define __USE_MINGW_STRTOX 1 @@ -1523,7 +1522,5 @@ #include <sec_api/wchar_s.h> -#include <_mingw_print_pop.h> - #endif /* _INC_WCHAR */
diff --git a/mingw-w64-headers/include/wspiapi.h b/mingw-w64-headers/include/wspiapi.h index 476a561..c95c46a 100644 --- a/mingw-w64-headers/include/wspiapi.h +++ b/mingw-w64-headers/include/wspiapi.h
@@ -12,8 +12,6 @@ #include <string.h> #include <ws2tcpip.h> -#include <_mingw_print_push.h> - #define _WSPIAPI_STRCPY_S(_Dst,_Size,_Src) strcpy((_Dst),(_Src)) #define _WSPIAPI_STRCAT_S(_Dst,_Size,_Src) strcat((_Dst),(_Src)) #define _WSPIAPI_STRNCPY_S(_Dst,_Size,_Src,_Count) strncpy((_Dst),(_Src),(_Count)); (_Dst)[(_Size) - 1] = 0 @@ -202,6 +200,4 @@ } #endif -#include <_mingw_print_pop.h> - #endif