X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Finttypes.h;h=c51769fae5449b6090f28927637704365279244f;hp=23acc5bec142e2acc041f654e2ec434a144efd31;hb=8389520ed5ad6f0033d6426e21ef653fa5ca26a4;hpb=400c5e5c8307a2ebe44ef1f203f5a15669f20347 diff --git a/include/inttypes.h b/include/inttypes.h index 23acc5be..c51769fa 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -5,17 +5,12 @@ extern "C" { #endif +#include #include #define __NEED_wchar_t #include -#if __STDC_VERSION__ >= 199901L -#define __restrict restrict -#elif !defined(__GNUC__) -#define __restrict -#endif - typedef struct { intmax_t quot, rem; } imaxdiv_t; intmax_t imaxabs(intmax_t); @@ -27,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" @@ -129,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" @@ -147,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" @@ -162,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" @@ -177,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" @@ -192,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" @@ -207,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" @@ -217,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 }