]>
sourceware.org Git - glibc.git/blob - sysdeps/wordsize-32/inttypes.h
1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 * ISO C 9X: 7.4 Integral types <inttypes.h>
26 /* Exact integral types. */
29 typedef signed char int8_t;
30 typedef short int int16_t;
32 typedef long long int int64_t;
35 typedef unsigned char uint8_t;
36 typedef unsigned short int uint16_t;
37 typedef unsigned int uint32_t;
38 typedef unsigned long long int uint64_t;
41 /* Largest integral types. */
42 typedef long long int intmax_t;
43 typedef unsigned long long int uintmax_t;
46 /* Types for `void *' pointers. */
48 typedef unsigned int uintptr_t;
51 /* Efficient types. */
52 typedef int intfast_t
;
53 typedef unsigned int uintfast_t
;
59 typedef signed char int_least8_t;
60 typedef short int int_least16_t;
61 typedef int int_least32_t;
62 typedef long long int int_least64_t;
65 typedef unsigned char uint_least8_t;
66 typedef unsigned short int uint_least16_t;
67 typedef unsigned int uint_least32_t;
68 typedef unsigned long long int uint_least64_t;
74 typedef signed char int_fast8_t;
75 typedef int int_fast16_t;
76 typedef int int_fast32_t;
77 typedef long long int int_fast64_t;
80 typedef unsigned char uint_fast8_t;
81 typedef unsigned int uint_fast16_t;
82 typedef unsigned int uint_fast32_t;
83 typedef unsigned long long int uint_fast64_t;
86 /* Limits of integral types. */
88 /* Minimum of signed integral types. */
89 #define INT8_MIN (-128)
90 #define INT16_MIN (-32767-1)
91 #define INT32_MIN (-2147483647-1)
92 #define INT64_MIN (-9223372036854775807LL-1)
93 /* Maximum of signed integral types. */
94 #define INT8_MAX (127)
95 #define INT16_MAX (32767)
96 #define INT32_MAX (2147483647)
97 #define INT64_MAX (9223372036854775807LL)
99 /* Maximum of unsigned integral types. */
100 #define UINT8_MAX (255U)
101 #define UINT16_MAX (65535U)
102 #define UINT32_MAX (4294967295U)
103 #define UINT64_MAX (18446744073709551615uLL)
106 /* Minimum of signed integral types having a minimum size. */
107 #define INT_LEAST8_MIN (-128)
108 #define INT_LEAST16_MIN (-32767-1)
109 #define INT_LEAST32_MIN (-2147483647-1)
110 #define INT_LEAST64_MIN (-9223372036854775807LL-1)
111 /* Maximum of signed integral types having a minimum size. */
112 #define INT_LEAST8_MAX (127)
113 #define INT_LEAST16_MAX (32767)
114 #define INT_LEAST32_MAX (2147483647)
115 #define INT_LEAST64_MAX (9223372036854775807LL)
117 /* Maximum of unsigned integral types having a minimum size. */
118 #define UINT_LEAST8_MAX (255U)
119 #define UINT_LEAST16_MAX (65535U)
120 #define UINT_LEAST32_MAX (4294967295U)
121 #define UINT_LEAST64_MAX (18446744073709551615uLL)
124 /* Minimum of fast signed integral types having a minimum size. */
125 #define INT_FAST8_MIN (-128)
126 #define INT_FAST16_MIN (-2147483647-1)
127 #define INT_FAST32_MIN (-2147483647-1)
128 #define INT_FAST64_MIN (-9223372036854775807LL-1)
129 /* Maximum of fast signed integral types having a minimum size. */
130 #define INT_FAST8_MAX (127)
131 #define INT_FAST16_MAX (2147483647)
132 #define INT_FAST32_MAX (2147483647)
133 #define INT_FAST64_MAX (9223372036854775807LL)
135 /* Maximum of fast unsigned integral types having a minimum size. */
136 #define UINT_FAST8_MAX (255U)
137 #define UINT_FAST16_MAX (4294967295U)
138 #define UINT_FAST32_MAX (4294967295U)
139 #define UINT_FAST64_MAX (18446744073709551615uLL)
142 /* Minimum for most efficient signed integral types. */
143 #define INTFAST_MIN (-128)
144 /* Maximum for most efficient signed integral types. */
145 #define INTFAST_MAX (127)
147 /* Maximum for most efficient unsigned integral types. */
148 #define UINTFAST_MAX (255)
151 /* Minimum for largest signed integral type. */
152 #define INTMAX_MIN (-9223372036854775807LL-1)
153 /* Maximum for largest signed integral type. */
154 #define INTMAX_MAX (9223372036854775807LL)
156 /* Maximum for largest unsigned integral type. */
157 #define UINTMAX_MAX (18446744073709551615uLL)
160 /* Values to test for integral types holding `void *' pointer. */
161 #define INTPTR_MAX (2147483647)
162 #define UINTPTR_MAX (4294967295U)
165 /* Macros for creating constants. */
166 #define __CONCAT__(A, B) A ## B
169 #define INT8_C(c) ((int8_t) c)
170 #define INT16_C(c) ((int16_t) c)
171 #define INT32_C(c) ((int32_t) c)
172 #define INT64_C(c) ((int64_t) __CONCAT__ (c,ll))
175 #define UINT8_C(c) ((uint8_t) __CONCAT__ (c,u))
176 #define UINT16_C(c) ((uint16_t) __CONCAT__ (c,u))
177 #define UINT32_C(c) ((uint32_t) __CONCAT__ (c,u))
178 #define UINT64_C(c) ((uint64_t) __CONCAT__ (c,ull))
181 #define INTMAX_C(c) ((intmax_t) __CONCAT__ (c,ll))
182 #define UINTMAX_C(c) ((uintmax_t) __CONCAT__ (c,ull))
185 /* Macros for printing format specifiers. */
187 /* Decimal notation. */
193 #define PRIdLEAST8 "d"
194 #define PRIdLEAST16 "d"
195 #define PRIdLEAST32 "d"
196 #define PRIdLEAST64 "lld"
198 #define PRIdFAST8 "d"
199 #define PRIdFAST16 "d"
200 #define PRIdFAST32 "d"
201 #define PRIdFAST64 "lld"
209 #define PRIiLEAST8 "i"
210 #define PRIiLEAST16 "i"
211 #define PRIiLEAST32 "i"
212 #define PRIiLEAST64 "lli"
214 #define PRIiFAST8 "i"
215 #define PRIiFAST16 "i"
216 #define PRIiFAST32 "i"
217 #define PRIiFAST64 "lli"
219 /* Octal notation. */
225 #define PRIoLEAST8 "o"
226 #define PRIoLEAST16 "o"
227 #define PRIoLEAST32 "o"
228 #define PRIoLEAST64 "llo"
230 #define PRIoFAST8 "o"
231 #define PRIoFAST16 "o"
232 #define PRIoFAST32 "o"
233 #define PRIoFAST64 "llo"
235 /* lowercase hexadecimal notation. */
241 #define PRIxLEAST8 "x"
242 #define PRIxLEAST16 "x"
243 #define PRIxLEAST32 "x"
244 #define PRIxLEAST64 "llx"
246 #define PRIxFAST8 "x"
247 #define PRIxFAST16 "x"
248 #define PRIxFAST32 "x"
249 #define PRIxFAST64 "llx"
251 /* UPPERCASE hexadecimal notation. */
257 #define PRIXLEAST8 "X"
258 #define PRIXLEAST16 "X"
259 #define PRIXLEAST32 "X"
260 #define PRIXLEAST64 "llX"
262 #define PRIXFAST8 "X"
263 #define PRIXFAST16 "X"
264 #define PRIXFAST32 "X"
265 #define PRIXFAST64 "llX"
268 /* Unsigned integers. */
274 #define PRIuLEAST8 "u"
275 #define PRIuLEAST16 "u"
276 #define PRIuLEAST32 "u"
277 #define PRIuLEAST64 "llu"
279 #define PRIuFAST8 "u"
280 #define PRIuFAST16 "u"
281 #define PRIuFAST32 "u"
282 #define PRIuFAST64 "llu"
285 /* Macros for printing `intmax_t' and `uintmax_t'. */
286 #define PRIdMAX "lld"
287 #define PRIoMAX "llo"
288 #define PRIxMAX "llx"
289 #define PRIuMAX "llu"
292 /* Macros for printing `intfast_t' and `uintfast_t'. */
299 /* Macros for printing `intptr_t' and `uintptr_t'. */
306 /* Macros for printing format specifiers. */
308 /* Decimal notation. */
317 /* Octal notation. */
322 /* Hexadecimal notation. */
328 /* Macros for scaning `intfast_t' and `uintfast_t'. */
334 /* Macros for scaning `intptr_t' and `uintptr_t'. */
340 #endif /* inttypes.h */
This page took 0.064651 seconds and 5 git commands to generate.