STM MATLAB Simulator
Loading...
Searching...
No Matches
stdint.h
Go to the documentation of this file.
1/* Copyright (C) ARM Ltd., 1999,2014 */
2/* All rights reserved */
3
4/*
5 * RCS $Revision$
6 * Checkin $Date$
7 * Revising $Author: agrant $
8 */
9
10#ifndef __stdint_h
11#define __stdint_h
12#define __ARMCLIB_VERSION 6190004
13
14 #ifdef __INT64_TYPE__
15 /* armclang predefines '__INT64_TYPE__' and '__INT64_C_SUFFIX__' */
16 #define __INT64 __INT64_TYPE__
17 #else
18 /* armcc has builtin '__int64' which can be used in --strict mode */
19 #define __INT64 __int64
20 #define __INT64_C_SUFFIX__ ll
21 #endif
22 #define __PASTE2(x, y) x ## y
23 #define __PASTE(x, y) __PASTE2(x, y)
24 #define __INT64_C(x) __ESCAPE__(__PASTE(x, __INT64_C_SUFFIX__))
25 #define __UINT64_C(x) __ESCAPE__(__PASTE(x ## u, __INT64_C_SUFFIX__))
26 #if defined(__clang__) || (defined(__ARMCC_VERSION) && !defined(__STRICT_ANSI__))
27 /* armclang and non-strict armcc allow 'long long' in system headers */
28 #define __LONGLONG long long
29 #else
30 /* strict armcc has '__int64' */
31 #define __LONGLONG __int64
32 #endif
33
34 #ifndef __STDINT_DECLS
35 #define __STDINT_DECLS
36
37 #undef __CLIBNS
38
39 #ifdef __cplusplus
40 namespace std {
41 #define __CLIBNS std::
42 extern "C" {
43 #else
44 #define __CLIBNS
45 #endif /* __cplusplus */
46
47
48/*
49 * 'signed' is redundant below, except for 'signed char' and if
50 * the typedef is used to declare a bitfield.
51 */
52
53 /* 7.18.1.1 */
54
55 /* exact-width signed integer types */
56typedef signed char int8_t;
57typedef signed short int int16_t;
58typedef signed int int32_t;
59typedef signed __INT64 int64_t;
60
61 /* exact-width unsigned integer types */
62typedef unsigned char uint8_t;
63typedef unsigned short int uint16_t;
64typedef unsigned int uint32_t;
65typedef unsigned __INT64 uint64_t;
66
67 /* 7.18.1.2 */
68
69 /* smallest type of at least n bits */
70 /* minimum-width signed integer types */
71typedef signed char int_least8_t;
72typedef signed short int int_least16_t;
73typedef signed int int_least32_t;
74typedef signed __INT64 int_least64_t;
75
76 /* minimum-width unsigned integer types */
77typedef unsigned char uint_least8_t;
78typedef unsigned short int uint_least16_t;
79typedef unsigned int uint_least32_t;
80typedef unsigned __INT64 uint_least64_t;
81
82 /* 7.18.1.3 */
83
84 /* fastest minimum-width signed integer types */
85typedef signed int int_fast8_t;
86typedef signed int int_fast16_t;
87typedef signed int int_fast32_t;
88typedef signed __INT64 int_fast64_t;
89
90 /* fastest minimum-width unsigned integer types */
91typedef unsigned int uint_fast8_t;
92typedef unsigned int uint_fast16_t;
93typedef unsigned int uint_fast32_t;
94typedef unsigned __INT64 uint_fast64_t;
95
96 /* 7.18.1.4 integer types capable of holding object pointers */
97#if __sizeof_ptr == 8
98typedef signed __INT64 intptr_t;
99typedef unsigned __INT64 uintptr_t;
100#else
101typedef signed int intptr_t;
102typedef unsigned int uintptr_t;
103#endif
104
105 /* 7.18.1.5 greatest-width integer types */
106typedef signed __LONGLONG intmax_t;
107typedef unsigned __LONGLONG uintmax_t;
108
109
110#if !defined(__cplusplus) || defined(__USE_C99_ALL) || 201103L <= __cplusplus || defined(__STDC_LIMIT_MACROS)
111
112 /* 7.18.2.1 */
113
114 /* minimum values of exact-width signed integer types */
115#define INT8_MIN -128
116#define INT16_MIN -32768
117#define INT32_MIN (~0x7fffffff) /* -2147483648 is unsigned */
118#define INT64_MIN __INT64_C(~0x7fffffffffffffff) /* -9223372036854775808 is unsigned */
119
120 /* maximum values of exact-width signed integer types */
121#define INT8_MAX 127
122#define INT16_MAX 32767
123#define INT32_MAX 2147483647
124#define INT64_MAX __INT64_C(9223372036854775807)
125
126 /* maximum values of exact-width unsigned integer types */
127#define UINT8_MAX 255
128#define UINT16_MAX 65535
129#define UINT32_MAX 4294967295u
130#define UINT64_MAX __UINT64_C(18446744073709551615)
131
132 /* 7.18.2.2 */
133
134 /* minimum values of minimum-width signed integer types */
135#define INT_LEAST8_MIN -128
136#define INT_LEAST16_MIN -32768
137#define INT_LEAST32_MIN (~0x7fffffff)
138#define INT_LEAST64_MIN __INT64_C(~0x7fffffffffffffff)
139
140 /* maximum values of minimum-width signed integer types */
141#define INT_LEAST8_MAX 127
142#define INT_LEAST16_MAX 32767
143#define INT_LEAST32_MAX 2147483647
144#define INT_LEAST64_MAX __INT64_C(9223372036854775807)
145
146 /* maximum values of minimum-width unsigned integer types */
147#define UINT_LEAST8_MAX 255
148#define UINT_LEAST16_MAX 65535
149#define UINT_LEAST32_MAX 4294967295u
150#define UINT_LEAST64_MAX __UINT64_C(18446744073709551615)
151
152 /* 7.18.2.3 */
153
154 /* minimum values of fastest minimum-width signed integer types */
155#define INT_FAST8_MIN (~0x7fffffff)
156#define INT_FAST16_MIN (~0x7fffffff)
157#define INT_FAST32_MIN (~0x7fffffff)
158#define INT_FAST64_MIN __INT64_C(~0x7fffffffffffffff)
159
160 /* maximum values of fastest minimum-width signed integer types */
161#define INT_FAST8_MAX 2147483647
162#define INT_FAST16_MAX 2147483647
163#define INT_FAST32_MAX 2147483647
164#define INT_FAST64_MAX __INT64_C(9223372036854775807)
165
166 /* maximum values of fastest minimum-width unsigned integer types */
167#define UINT_FAST8_MAX 4294967295u
168#define UINT_FAST16_MAX 4294967295u
169#define UINT_FAST32_MAX 4294967295u
170#define UINT_FAST64_MAX __UINT64_C(18446744073709551615)
171
172 /* 7.18.2.4 */
173
174 /* minimum value of pointer-holding signed integer type */
175#if __sizeof_ptr == 8
176#define INTPTR_MIN INT64_MIN
177#else
178#define INTPTR_MIN INT32_MIN
179#endif
180
181 /* maximum value of pointer-holding signed integer type */
182#if __sizeof_ptr == 8
183#define INTPTR_MAX INT64_MAX
184#else
185#define INTPTR_MAX INT32_MAX
186#endif
187
188 /* maximum value of pointer-holding unsigned integer type */
189#if __sizeof_ptr == 8
190#define UINTPTR_MAX UINT64_MAX
191#else
192#define UINTPTR_MAX UINT32_MAX
193#endif
194
195 /* 7.18.2.5 */
196
197 /* minimum value of greatest-width signed integer type */
198#define INTMAX_MIN __ESCAPE__(~0x7fffffffffffffffll)
199
200 /* maximum value of greatest-width signed integer type */
201#define INTMAX_MAX __ESCAPE__(9223372036854775807ll)
202
203 /* maximum value of greatest-width unsigned integer type */
204#define UINTMAX_MAX __ESCAPE__(18446744073709551615ull)
205
206 /* 7.18.3 */
207
208 /* limits of ptrdiff_t */
209#if __sizeof_ptr == 8
210#define PTRDIFF_MIN INT64_MIN
211#define PTRDIFF_MAX INT64_MAX
212#else
213#define PTRDIFF_MIN INT32_MIN
214#define PTRDIFF_MAX INT32_MAX
215#endif
216
217 /* limits of sig_atomic_t */
218#define SIG_ATOMIC_MIN (~0x7fffffff)
219#define SIG_ATOMIC_MAX 2147483647
220
221 /* limit of size_t */
222#if __sizeof_ptr == 8
223#define SIZE_MAX UINT64_MAX
224#else
225#define SIZE_MAX UINT32_MAX
226#endif
227
228 /* limits of wchar_t */
229 /* NB we have to undef and redef because they're defined in both
230 * stdint.h and wchar.h */
231#undef WCHAR_MIN
232#undef WCHAR_MAX
233
234#if defined(__WCHAR32) || (defined(__ARM_SIZEOF_WCHAR_T) && __ARM_SIZEOF_WCHAR_T == 4)
235 #define WCHAR_MIN 0
236 #define WCHAR_MAX 0xffffffffU
237#else
238 #define WCHAR_MIN 0
239 #define WCHAR_MAX 65535
240#endif
241
242 /* limits of wint_t */
243#define WINT_MIN (~0x7fffffff)
244#define WINT_MAX 2147483647
245
246#endif /* __STDC_LIMIT_MACROS */
247
248#if !defined(__cplusplus) || defined(__USE_C99_ALL) || 201103L <= __cplusplus || defined(__STDC_CONSTANT_MACROS)
249
250 /* 7.18.4.1 macros for minimum-width integer constants */
251#define INT8_C(x) (x)
252#define INT16_C(x) (x)
253#define INT32_C(x) (x)
254#define INT64_C(x) __INT64_C(x)
255
256#define UINT8_C(x) (x ## u)
257#define UINT16_C(x) (x ## u)
258#define UINT32_C(x) (x ## u)
259#define UINT64_C(x) __UINT64_C(x)
260
261 /* 7.18.4.2 macros for greatest-width integer constants */
262#define INTMAX_C(x) __ESCAPE__(x ## ll)
263#define UINTMAX_C(x) __ESCAPE__(x ## ull)
264
265#endif /* __STDC_CONSTANT_MACROS */
266
267 #ifdef __cplusplus
268 } /* extern "C" */
269 } /* namespace std */
270 #endif /* __cplusplus */
271 #endif /* __STDINT_DECLS */
272
273 #ifdef __cplusplus
274 #ifndef __STDINT_NO_EXPORTS
275 using ::std::int8_t;
276 using ::std::int16_t;
277 using ::std::int32_t;
278 using ::std::int64_t;
279 using ::std::uint8_t;
280 using ::std::uint16_t;
281 using ::std::uint32_t;
282 using ::std::uint64_t;
283 using ::std::int_least8_t;
284 using ::std::int_least16_t;
285 using ::std::int_least32_t;
286 using ::std::int_least64_t;
287 using ::std::uint_least8_t;
288 using ::std::uint_least16_t;
289 using ::std::uint_least32_t;
290 using ::std::uint_least64_t;
291 using ::std::int_fast8_t;
292 using ::std::int_fast16_t;
293 using ::std::int_fast32_t;
294 using ::std::int_fast64_t;
295 using ::std::uint_fast8_t;
296 using ::std::uint_fast16_t;
297 using ::std::uint_fast32_t;
298 using ::std::uint_fast64_t;
299 using ::std::intptr_t;
300 using ::std::uintptr_t;
301 using ::std::intmax_t;
302 using ::std::uintmax_t;
303 #endif
304 #endif /* __cplusplus */
305
306#undef __INT64
307#undef __LONGLONG
308
309#endif /* __stdint_h */
310
311/* end of stdint.h */
signed __INT64 int64_t
Definition stdint.h:59
#define __INT64
Definition stdint.h:19
unsigned short int uint_least16_t
Definition stdint.h:78
signed __INT64 int_fast64_t
Definition stdint.h:88
signed int int_least32_t
Definition stdint.h:73
unsigned int uint_fast16_t
Definition stdint.h:92
unsigned __INT64 uint_fast64_t
Definition stdint.h:94
unsigned __LONGLONG uintmax_t
Definition stdint.h:107
signed int int_fast8_t
Definition stdint.h:85
unsigned __INT64 uint_least64_t
Definition stdint.h:80
unsigned int uint32_t
Definition stdint.h:64
unsigned int uint_fast32_t
Definition stdint.h:93
unsigned int uintptr_t
Definition stdint.h:102
signed int int_fast16_t
Definition stdint.h:86
unsigned int uint_least32_t
Definition stdint.h:79
signed short int int16_t
Definition stdint.h:57
signed __INT64 int_least64_t
Definition stdint.h:74
signed int intptr_t
Definition stdint.h:101
unsigned char uint_least8_t
Definition stdint.h:77
signed int int32_t
Definition stdint.h:58
unsigned char uint8_t
Definition stdint.h:62
signed short int int_least16_t
Definition stdint.h:72
unsigned int uint_fast8_t
Definition stdint.h:91
signed __LONGLONG intmax_t
Definition stdint.h:106
unsigned short int uint16_t
Definition stdint.h:63
signed char int_least8_t
Definition stdint.h:71
signed int int_fast32_t
Definition stdint.h:87
unsigned __INT64 uint64_t
Definition stdint.h:65
signed char int8_t
Definition stdint.h:56
#define __LONGLONG
Definition stdint.h:31