8 #include <klibc/extern.h>
12 static __inline__
intmax_t imaxabs(intmax_t __n
)
14 return (__n
< (intmax_t)0) ? -__n
: __n
;
17 __extern
intmax_t strtoimax(const char *, char **, int);
18 __extern
uintmax_t strtoumax(const char *, char **, int);
21 __extern
intmax_t strntoimax(const char *, char **, int, size_t);
22 __extern
uintmax_t strntoumax(const char *, char **, int, size_t);
24 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
29 #define PRId64 __PRI64_RANK "d"
31 #define PRIdLEAST8 "d"
32 #define PRIdLEAST16 "d"
33 #define PRIdLEAST32 "d"
34 #define PRIdLEAST64 __PRI64_RANK "d"
37 #define PRIdFAST16 __PRIFAST_RANK "d"
38 #define PRIdFAST32 __PRIFAST_RANK "d"
39 #define PRIdFAST64 __PRI64_RANK "d"
41 #define PRIdMAX __PRI64_RANK "d"
42 #define PRIdPTR __PRIPTR_RANK "d"
47 #define PRIi64 __PRI64_RANK "i"
49 #define PRIiLEAST8 "i"
50 #define PRIiLEAST16 "i"
51 #define PRIiLEAST32 "i"
52 #define PRIiLEAST64 __PRI64_RANK "i"
55 #define PRIiFAST16 __PRIFAST_RANK "i"
56 #define PRIiFAST32 __PRIFAST_RANK "i"
57 #define PRIiFAST64 __PRI64_RANK "i"
59 #define PRIiMAX __PRI64_RANK "i"
60 #define PRIiPTR __PRIPTR_RANK "i"
65 #define PRIo64 __PRI64_RANK "o"
67 #define PRIoLEAST8 "o"
68 #define PRIoLEAST16 "o"
69 #define PRIoLEAST32 "o"
70 #define PRIoLEAST64 __PRI64_RANK "o"
73 #define PRIoFAST16 __PRIFAST_RANK "o"
74 #define PRIoFAST32 __PRIFAST_RANK "o"
75 #define PRIoFAST64 __PRI64_RANK "o"
77 #define PRIoMAX __PRI64_RANK "o"
78 #define PRIoPTR __PRIPTR_RANK "o"
83 #define PRIu64 __PRI64_RANK "u"
85 #define PRIuLEAST8 "u"
86 #define PRIuLEAST16 "u"
87 #define PRIuLEAST32 "u"
88 #define PRIuLEAST64 __PRI64_RANK "u"
91 #define PRIuFAST16 __PRIFAST_RANK "u"
92 #define PRIuFAST32 __PRIFAST_RANK "u"
93 #define PRIuFAST64 __PRI64_RANK "u"
95 #define PRIuMAX __PRI64_RANK "u"
96 #define PRIuPTR __PRIPTR_RANK "u"
101 #define PRIx64 __PRI64_RANK "x"
103 #define PRIxLEAST8 "x"
104 #define PRIxLEAST16 "x"
105 #define PRIxLEAST32 "x"
106 #define PRIxLEAST64 __PRI64_RANK "x"
108 #define PRIxFAST8 "x"
109 #define PRIxFAST16 __PRIFAST_RANK "x"
110 #define PRIxFAST32 __PRIFAST_RANK "x"
111 #define PRIxFAST64 __PRI64_RANK "x"
113 #define PRIxMAX __PRI64_RANK "x"
114 #define PRIxPTR __PRIPTR_RANK "x"
119 #define PRIX64 __PRI64_RANK "X"
121 #define PRIXLEAST8 "X"
122 #define PRIXLEAST16 "X"
123 #define PRIXLEAST32 "X"
124 #define PRIXLEAST64 __PRI64_RANK "X"
126 #define PRIXFAST8 "X"
127 #define PRIXFAST16 __PRIFAST_RANK "X"
128 #define PRIXFAST32 __PRIFAST_RANK "X"
129 #define PRIXFAST64 __PRI64_RANK "X"
131 #define PRIXMAX __PRI64_RANK "X"
132 #define PRIXPTR __PRIPTR_RANK "X"
137 #define SCNd64 __PRI64_RANK "d"
139 #define SCNdLEAST8 "hhd"
140 #define SCNdLEAST16 "hd"
141 #define SCNdLEAST32 "d"
142 #define SCNdLEAST64 __PRI64_RANK "d"
144 #define SCNdFAST8 "hhd"
145 #define SCNdFAST16 __PRIFAST_RANK "d"
146 #define SCNdFAST32 __PRIFAST_RANK "d"
147 #define SCNdFAST64 __PRI64_RANK "d"
149 #define SCNdMAX __PRI64_RANK "d"
150 #define SCNdPTR __PRIPTR_RANK "d"
155 #define SCNi64 __PRI64_RANK "i"
157 #define SCNiLEAST8 "hhi"
158 #define SCNiLEAST16 "hi"
159 #define SCNiLEAST32 "i"
160 #define SCNiLEAST64 __PRI64_RANK "i"
162 #define SCNiFAST8 "hhi"
163 #define SCNiFAST16 __PRIFAST_RANK "i"
164 #define SCNiFAST32 __PRIFAST_RANK "i"
165 #define SCNiFAST64 __PRI64_RANK "i"
167 #define SCNiMAX __PRI64_RANK "i"
168 #define SCNiPTR __PRIPTR_RANK "i"
173 #define SCNo64 __PRI64_RANK "o"
175 #define SCNoLEAST8 "hho"
176 #define SCNoLEAST16 "ho"
177 #define SCNoLEAST32 "o"
178 #define SCNoLEAST64 __PRI64_RANK "o"
180 #define SCNoFAST8 "hho"
181 #define SCNoFAST16 __PRIFAST_RANK "o"
182 #define SCNoFAST32 __PRIFAST_RANK "o"
183 #define SCNoFAST64 __PRI64_RANK "o"
185 #define SCNoMAX __PRI64_RANK "o"
186 #define SCNoPTR __PRIPTR_RANK "o"
191 #define SCNu64 __PRI64_RANK "u"
193 #define SCNuLEAST8 "hhu"
194 #define SCNuLEAST16 "hu"
195 #define SCNuLEAST32 "u"
196 #define SCNuLEAST64 __PRI64_RANK "u"
198 #define SCNuFAST8 "hhu"
199 #define SCNuFAST16 __PRIFAST_RANK "u"
200 #define SCNuFAST32 __PRIFAST_RANK "u"
201 #define SCNuFAST64 __PRI64_RANK "u"
203 #define SCNuMAX __PRI64_RANK "u"
204 #define SCNuPTR __PRIPTR_RANK "u"
209 #define SCNx64 __PRI64_RANK "x"
211 #define SCNxLEAST8 "hhx"
212 #define SCNxLEAST16 "hx"
213 #define SCNxLEAST32 "x"
214 #define SCNxLEAST64 __PRI64_RANK "x"
216 #define SCNxFAST8 "hhx"
217 #define SCNxFAST16 __PRIFAST_RANK "x"
218 #define SCNxFAST32 __PRIFAST_RANK "x"
219 #define SCNxFAST64 __PRI64_RANK "x"
221 #define SCNxMAX __PRI64_RANK "x"
222 #define SCNxPTR __PRIPTR_RANK "x"
226 #endif /* _INTTYPES_H */