X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Finttypes.h;h=c51769fae5449b6090f28927637704365279244f;hb=9578f0530ae9eebfc9928b76f8ab2972131c2dac;hp=3f0339ce340e3382d69d5a7f32117d6808e89fa1;hpb=455f96857f91d14e193219ca00969354a981c09c;p=musl diff --git a/include/inttypes.h b/include/inttypes.h index 3f0339ce..c51769fa 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -22,10 +22,11 @@ uintmax_t strtoumax(const char *__restrict, char **__restrict, int); intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int); uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); -#if !defined __cplusplus || defined __STDC_FORMAT_MACROS - +#if UINTPTR_MAX == UINT64_MAX +#define __PRI64 "l" +#else #define __PRI64 "ll" -#define __PRIPTR "l" +#endif #define PRId8 "d" #define PRId16 "d" @@ -124,12 +125,12 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define PRIxMAX __PRI64 "x" #define PRIXMAX __PRI64 "X" -#define PRIdPTR __PRIPTR "d" -#define PRIiPTR __PRIPTR "i" -#define PRIoPTR __PRIPTR "o" -#define PRIuPTR __PRIPTR "u" -#define PRIxPTR __PRIPTR "x" -#define PRIXPTR __PRIPTR "X" +#define PRIdPTR "ld" +#define PRIiPTR "li" +#define PRIoPTR "lo" +#define PRIuPTR "lu" +#define PRIxPTR "lx" +#define PRIXPTR "lX" #define SCNd8 "hhd" #define SCNd16 "hd" @@ -142,8 +143,8 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define SCNdLEAST64 __PRI64 "d" #define SCNdFAST8 "hhd" -#define SCNdFAST16 __PRIPTR "d" -#define SCNdFAST32 __PRIPTR "d" +#define SCNdFAST16 "d" +#define SCNdFAST32 "d" #define SCNdFAST64 __PRI64 "d" #define SCNi8 "hhi" @@ -157,8 +158,8 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define SCNiLEAST64 __PRI64 "i" #define SCNiFAST8 "hhi" -#define SCNiFAST16 __PRIPTR "i" -#define SCNiFAST32 __PRIPTR "i" +#define SCNiFAST16 "i" +#define SCNiFAST32 "i" #define SCNiFAST64 __PRI64 "i" #define SCNu8 "hhu" @@ -172,8 +173,8 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define SCNuLEAST64 __PRI64 "u" #define SCNuFAST8 "hhu" -#define SCNuFAST16 __PRIPTR "u" -#define SCNuFAST32 __PRIPTR "u" +#define SCNuFAST16 "u" +#define SCNuFAST32 "u" #define SCNuFAST64 __PRI64 "u" #define SCNo8 "hho" @@ -187,8 +188,8 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define SCNoLEAST64 __PRI64 "o" #define SCNoFAST8 "hho" -#define SCNoFAST16 __PRIPTR "o" -#define SCNoFAST32 __PRIPTR "o" +#define SCNoFAST16 "o" +#define SCNoFAST32 "o" #define SCNoFAST64 __PRI64 "o" #define SCNx8 "hhx" @@ -202,8 +203,8 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define SCNxLEAST64 __PRI64 "x" #define SCNxFAST8 "hhx" -#define SCNxFAST16 __PRIPTR "x" -#define SCNxFAST32 __PRIPTR "x" +#define SCNxFAST16 "x" +#define SCNxFAST32 "x" #define SCNxFAST64 __PRI64 "x" #define SCNdMAX __PRI64 "d" @@ -212,13 +213,11 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); #define SCNuMAX __PRI64 "u" #define SCNxMAX __PRI64 "x" -#define SCNdPTR __PRIPTR "d" -#define SCNiPTR __PRIPTR "i" -#define SCNoPTR __PRIPTR "o" -#define SCNuPTR __PRIPTR "u" -#define SCNxPTR __PRIPTR "x" - -#endif +#define SCNdPTR "ld" +#define SCNiPTR "li" +#define SCNoPTR "lo" +#define SCNuPTR "lu" +#define SCNxPTR "lx" #ifdef __cplusplus }