+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
/* 7.8 Format conversion of integer types <inttypes.h> */
#ifndef _INTTYPES_H_
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
/* 7.8.1 Macros for format specifiers
- *
+ *
* MS runtime does not yet understand C9x standard "ll"
* length specifier. It appears to treat "ll" as "l".
* The non-standard I64 length specifier causes warning in GCC,
#define PRIdFAST64 "I64d"
#define PRIdMAX "I64d"
-#define PRIdPTR "d"
#define PRIi8 "i"
#define PRIi16 "i"
#define PRIiFAST64 "I64i"
#define PRIiMAX "I64i"
-#define PRIiPTR "i"
#define PRIo8 "o"
#define PRIo16 "o"
#define PRIoMAX "I64o"
-#define PRIoPTR "o"
-
/* fprintf macros for unsigned types */
#define PRIu8 "u"
#define PRIu16 "u"
#define PRIuFAST64 "I64u"
#define PRIuMAX "I64u"
-#define PRIuPTR "u"
#define PRIx8 "x"
#define PRIx16 "x"
#define PRIxFAST64 "I64x"
#define PRIxMAX "I64x"
-#define PRIxPTR "x"
#define PRIX8 "X"
#define PRIX16 "X"
#define PRIXFAST64 "I64X"
#define PRIXMAX "I64X"
-#define PRIXPTR "X"
/*
* fscanf macros for signed int types
#define SCNdFAST64 "I64d"
#define SCNdMAX "I64d"
-#define SCNdPTR "d"
#define SCNi16 "hi"
#define SCNi32 "i"
#define SCNiFAST64 "I64i"
#define SCNiMAX "I64i"
-#define SCNiPTR "i"
#define SCNo16 "ho"
#define SCNo32 "o"
#define SCNoFAST64 "I64o"
#define SCNoMAX "I64o"
-#define SCNoPTR "o"
#define SCNx16 "hx"
#define SCNx32 "x"
#define SCNxFAST64 "I64x"
#define SCNxMAX "I64x"
-#define SCNxPTR "x"
-
/* fscanf macros for unsigned int types */
#define SCNuFAST64 "I64u"
#define SCNuMAX "I64u"
-#define SCNuPTR "u"
+
+#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"
+#else
+#define PRIdPTR "d"
+#define PRIiPTR "i"
+#define PRIoPTR "o"
+#define PRIuPTR "u"
+#define PRIxPTR "x"
+#define PRIXPTR "X"
+#define SCNdPTR "d"
+#define SCNiPTR "i"
+#define SCNoPTR "o"
+#define SCNxPTR "x"
+ #define SCNuPTR "u"
+#endif
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/*
* no length modifier for char types prior to C9x
- * MS runtime scanf appears to treat "hh" as "h"
+ * MS runtime scanf appears to treat "hh" as "h"
*/
/* signed char */
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
-__CRT_INLINE intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j)
+intmax_t __cdecl imaxabs (intmax_t j);
+__CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j)
{return (j >= 0 ? j : -j);}
-imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom);
+imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom);
/* 7.8.2 Conversion functions for greatest-width integer types */
-intmax_t __cdecl __MINGW_NOTHROW strtoimax (const char* __restrict__ nptr,
+intmax_t __cdecl strtoimax (const char* __restrict__ nptr,
char** __restrict__ endptr, int base);
-uintmax_t __cdecl __MINGW_NOTHROW strtoumax (const char* __restrict__ nptr,
+uintmax_t __cdecl strtoumax (const char* __restrict__ nptr,
char** __restrict__ endptr, int base);
-intmax_t __cdecl __MINGW_NOTHROW wcstoimax (const wchar_t* __restrict__ nptr,
+intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr,
wchar_t** __restrict__ endptr, int base);
-uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr,
+uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr,
wchar_t** __restrict__ endptr, int base);
#ifdef __cplusplus