1 /*****************************************************************************/
5 /* Format conversion of integer types */
9 /* (C) 2002-2011, Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
36 /* Note: This file is not fully ISO 9899-1999 compliant because cc65 lacks
37 * a 64 bit data types and is not able to return structs > 4 bytes. The
38 * declarations have been adjusted accordingly or left out.
48 /* inttypes.h must always include stdint.h */
55 /* Standard functions */
56 intmax_t __fastcall__ imaxabs (intmax_t val);
57 intmax_t __fastcall__ strtoimax (const char* nptr, char** endptr, int base);
58 uintmax_t __fastcall__ strtoumax (const char* nptr, char** endptr, int base);
62 /* printf() macros for signed integers */
67 #define PRIdLEAST8 "d"
68 #define PRIdLEAST16 "d"
69 #define PRIdLEAST32 "ld"
72 #define PRIdFAST16 "d"
73 #define PRIdFAST32 "ld"
82 #define PRIiLEAST8 "i"
83 #define PRIiLEAST16 "i"
84 #define PRIiLEAST32 "li"
87 #define PRIiFAST16 "i"
88 #define PRIiFAST32 "li"
93 /* fprintf() macros for unsigned integers */
98 #define PRIoLEAST8 "o"
99 #define PRIoLEAST16 "o"
100 #define PRIoLEAST32 "lo"
102 #define PRIoFAST8 "o"
103 #define PRIoFAST16 "o"
104 #define PRIoFAST32 "lo"
113 #define PRIuLEAST8 "u"
114 #define PRIuLEAST16 "u"
115 #define PRIuLEAST32 "lu"
117 #define PRIuFAST8 "u"
118 #define PRIuFAST16 "u"
119 #define PRIuFAST32 "lu"
128 #define PRIxLEAST8 "x"
129 #define PRIxLEAST16 "x"
130 #define PRIxLEAST32 "lx"
132 #define PRIxFAST8 "x"
133 #define PRIxFAST16 "x"
134 #define PRIxFAST32 "lx"
143 #define PRIXLEAST8 "X"
144 #define PRIXLEAST16 "X"
145 #define PRIXLEAST32 "lX"
147 #define PRIXFAST8 "X"
148 #define PRIXFAST16 "X"
149 #define PRIXFAST32 "lX"
154 /* fscanf() macros for signed integers */
159 #define SCNdLEAST8 "hd"
160 #define SCNdLEAST16 "d"
161 #define SCNdLEAST32 "ld"
163 #define SCNdFAST8 "hd"
164 #define SCNdFAST16 "d"
165 #define SCNdFAST32 "ld"
174 #define SCNiLEAST8 "hi"
175 #define SCNiLEAST16 "i"
176 #define SCNiLEAST32 "li"
178 #define SCNiFAST8 "hi"
179 #define SCNiFAST16 "i"
180 #define SCNiFAST32 "li"
185 /* fscanf() macros for unsigned integers */
190 #define SCNoLEAST8 "ho"
191 #define SCNoLEAST16 "o"
192 #define SCNoLEAST32 "lo"
194 #define SCNoFAST8 "ho"
195 #define SCNoFAST16 "o"
196 #define SCNoFAST32 "lo"
205 #define SCNuLEAST8 "hu"
206 #define SCNuLEAST16 "u"
207 #define SCNuLEAST32 "lu"
209 #define SCNuFAST8 "hu"
210 #define SCNuFAST16 "u"
211 #define SCNuFAST32 "lu"
220 #define SCNxLEAST8 "hx"
221 #define SCNxLEAST16 "x"
222 #define SCNxLEAST32 "lx"
224 #define SCNxFAST8 "hx"
225 #define SCNxFAST16 "x"
226 #define SCNxFAST32 "lx"
233 /* End of inttypes.h */