-
Notifications
You must be signed in to change notification settings - Fork 1
/
stdint.h
262 lines (204 loc) · 7.48 KB
/
stdint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/* stdint.h standard header */
/* Copyright 2003-2010 IAR Systems AB. */
#ifndef _STDINT
#define _STDINT
#ifndef _SYSTEM_BUILD
#pragma system_include
#endif
#include <ycheck.h>
#include <yvals.h>
/* _C_STD_BEGIN */
/* Fixed size types. These are all optional. */
#ifdef __INT8_T_TYPE__
typedef __INT8_T_TYPE__ int8_t;
typedef __UINT8_T_TYPE__ uint8_t;
#endif /* __INT8_T_TYPE__ */
#ifdef __INT16_T_TYPE__
typedef __INT16_T_TYPE__ int16_t;
typedef __UINT16_T_TYPE__ uint16_t;
#endif /* __INT16_T_TYPE__ */
#ifdef __INT32_T_TYPE__
typedef __INT32_T_TYPE__ int32_t;
typedef __UINT32_T_TYPE__ uint32_t;
#endif /* __INT32_T_TYPE__ */
#ifdef __INT64_T_TYPE__
#pragma language=save
#pragma language=extended
typedef __INT64_T_TYPE__ int64_t;
typedef __UINT64_T_TYPE__ uint64_t;
#pragma language=restore
#endif /* __INT64_T_TYPE__ */
/* Types capable of holding at least a certain number of bits.
These are not optional for the sizes 8, 16, 32, 64. */
typedef __INT_LEAST8_T_TYPE__ int_least8_t;
typedef __UINT_LEAST8_T_TYPE__ uint_least8_t;
typedef __INT_LEAST16_T_TYPE__ int_least16_t;
typedef __UINT_LEAST16_T_TYPE__ uint_least16_t;
typedef __INT_LEAST32_T_TYPE__ int_least32_t;
typedef __UINT_LEAST32_T_TYPE__ uint_least32_t;
/* This isn't really optional, but make it so for now. */
#ifdef __INT_LEAST64_T_TYPE__
#pragma language=save
#pragma language=extended
typedef __INT_LEAST64_T_TYPE__ int_least64_t;
#pragma language=restore
#endif /* __INT_LEAST64_T_TYPE__ */
#ifdef __UINT_LEAST64_T_TYPE__
#pragma language=save
#pragma language=extended
typedef __UINT_LEAST64_T_TYPE__ uint_least64_t;
#pragma language=restore
#endif /* __UINT_LEAST64_T_TYPE__ */
/* The fastest type holding at least a certain number of bits.
These are not optional for the size 8, 16, 32, 64.
For now, the 64 bit size is optional in IAR compilers. */
typedef __INT_FAST8_T_TYPE__ int_fast8_t;
typedef __UINT_FAST8_T_TYPE__ uint_fast8_t;
typedef __INT_FAST16_T_TYPE__ int_fast16_t;
typedef __UINT_FAST16_T_TYPE__ uint_fast16_t;
typedef __INT_FAST32_T_TYPE__ int_fast32_t;
typedef __UINT_FAST32_T_TYPE__ uint_fast32_t;
#ifdef __INT_FAST64_T_TYPE__
#pragma language=save
#pragma language=extended
typedef __INT_FAST64_T_TYPE__ int_fast64_t;
#pragma language=restore
#endif /* __INT_FAST64_T_TYPE__ */
#ifdef __UINT_FAST64_T_TYPE__
#pragma language=save
#pragma language=extended
typedef __UINT_FAST64_T_TYPE__ uint_fast64_t;
#pragma language=restore
#endif /* __UINT_FAST64_T_TYPE__ */
/* The integer type capable of holding the largest number of bits. */
#pragma language=save
#pragma language=extended
typedef __INTMAX_T_TYPE__ intmax_t;
typedef __UINTMAX_T_TYPE__ uintmax_t;
#pragma language=restore
/* An integer type large enough to be able to hold a pointer.
This is optional, but always supported in IAR compilers. */
typedef __INTPTR_T_TYPE__ intptr_t;
typedef __UINTPTR_T_TYPE__ uintptr_t;
/* An integer capable of holding a pointer to a specific memory type. */
#define __DATA_PTR_MEM_HELPER1__(M, I) \
typedef __DATA_MEM##I##_INTPTR_TYPE__ M##_intptr_t; \
typedef __DATA_MEM##I##_UINTPTR_TYPE__ M##_uintptr_t;
__DATA_PTR_MEMORY_LIST1__()
#undef __DATA_PTR_MEM_HELPER1__
/* Minimum and maximum limits. */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
#ifdef __INT8_T_TYPE__
#define INT8_MAX __INT8_T_MAX__
#define INT8_MIN __INT8_T_MIN__
#define UINT8_MAX __UINT8_T_MAX__
#endif
#ifdef __INT16_T_TYPE__
#define INT16_MAX __INT16_T_MAX__
#define INT16_MIN __INT16_T_MIN__
#define UINT16_MAX __UINT16_T_MAX__
#endif
#ifdef __INT32_T_TYPE__
#define INT32_MAX __INT32_T_MAX__
#define INT32_MIN __INT32_T_MIN__
#define UINT32_MAX __UINT32_T_MAX__
#endif
#ifdef __INT64_T_TYPE__
#define INT64_MAX __INT64_T_MAX__
#define INT64_MIN __INT64_T_MIN__
#define UINT64_MAX __UINT64_T_MAX__
#endif
#define INT_LEAST8_MAX __INT_LEAST8_T_MAX__
#define INT_LEAST8_MIN __INT_LEAST8_T_MIN__
#define UINT_LEAST8_MAX __UINT_LEAST8_T_MAX__
#define INT_LEAST16_MAX __INT_LEAST16_T_MAX__
#define INT_LEAST16_MIN __INT_LEAST16_T_MIN__
#define UINT_LEAST16_MAX __UINT_LEAST16_T_MAX__
#define INT_LEAST32_MAX __INT_LEAST32_T_MAX__
#define INT_LEAST32_MIN __INT_LEAST32_T_MIN__
#define UINT_LEAST32_MAX __UINT_LEAST32_T_MAX__
#ifdef __INT_LEAST64_T_TYPE__
#define INT_LEAST64_MAX __INT_LEAST64_T_MAX__
#define INT_LEAST64_MIN __INT_LEAST64_T_MIN__
#endif
#ifdef __UINT_LEAST64_T_TYPE__
#define UINT_LEAST64_MAX __UINT_LEAST64_T_MAX__
#endif
#define INT_FAST8_MAX __INT_FAST8_T_MAX__
#define INT_FAST8_MIN __INT_FAST8_T_MIN__
#define UINT_FAST8_MAX __UINT_FAST8_T_MAX__
#define INT_FAST16_MAX __INT_FAST16_T_MAX__
#define INT_FAST16_MIN __INT_FAST16_T_MIN__
#define UINT_FAST16_MAX __UINT_FAST16_T_MAX__
#define INT_FAST32_MAX __INT_FAST32_T_MAX__
#define INT_FAST32_MIN __INT_FAST32_T_MIN__
#define UINT_FAST32_MAX __UINT_FAST32_T_MAX__
#ifdef __INT_FAST64_T_TYPE__
#define INT_FAST64_MAX __INT_FAST64_T_MAX__
#define INT_FAST64_MIN __INT_FAST64_T_MIN__
#endif
#ifdef __UINT_FAST64_T_TYPE__
#define UINT_FAST64_MAX __UINT_FAST64_T_MAX__
#endif
#define INTMAX_MAX __INTMAX_T_MAX__
#define INTMAX_MIN __INTMAX_T_MIN__
#define UINTMAX_MAX __UINTMAX_T_MAX__
#define SIZE_MAX __SIZE_T_MAX__
#define PTRDIFF_MAX __PTRDIFF_T_MAX__
#define PTRDIFF_MIN __PTRDIFF_T_MIN__
#define INTPTR_MAX __INTPTR_T_MAX__
#define INTPTR_MIN __INTPTR_T_MIN__
#define UINTPTR_MAX __UINTPTR_T_MAX__
#define WCHAR_MIN _WCMIN
#define WCHAR_MAX _WCMAX
#define WINT_MIN _WIMIN
#define WINT_MAX _WIMAX
#define SIG_ATOMIC_MIN __SIGNED_CHAR_MIN__
#define SIG_ATOMIC_MAX __SIGNED_CHAR_MAX__
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
/* Macros expanding to integer constants. */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#ifdef __INT8_T_TYPE__
#define INT8_C(x) _GLUE(x,__INT8_C_SUFFIX__)
#define UINT8_C(x) _GLUE(x,__UINT8_C_SUFFIX__)
#endif
#ifdef __INT16_T_TYPE__
#define INT16_C(x) _GLUE(x,__INT16_C_SUFFIX__)
#define UINT16_C(x) _GLUE(x,__UINT16_C_SUFFIX__)
#endif
#ifdef __INT32_T_TYPE__
#define INT32_C(x) _GLUE(x,__INT32_C_SUFFIX__)
#define UINT32_C(x) _GLUE(x,__UINT32_C_SUFFIX__)
#endif
#ifdef __INT_LEAST64_T_TYPE__
#define INT64_C(x) _GLUE(x,__INT64_C_SUFFIX__)
#endif
#ifdef __UINT_LEAST64_T_TYPE__
#define UINT64_C(x) _GLUE(x,__UINT64_C_SUFFIX__)
#endif
#define INTMAX_C(x) _GLUE(x,__INTMAX_C_SUFFIX__)
#define UINTMAX_C(x) _GLUE(x,__UINTMAX_C_SUFFIX__)
#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
/* _C_STD_BEGIN */
#endif /* _STDINT */
#if defined(_STD_USING)
using _CSTD int8_t; using _CSTD int16_t;
using _CSTD int32_t; using _CSTD int64_t;
using _CSTD uint8_t; using _CSTD uint16_t;
using _CSTD uint32_t; using _CSTD uint64_t;
using _CSTD int_least8_t; using _CSTD int_least16_t;
using _CSTD int_least32_t; using _CSTD int_least64_t;
using _CSTD uint_least8_t; using _CSTD uint_least16_t;
using _CSTD uint_least32_t; using _CSTD uint_least64_t;
using _CSTD intmax_t; using _CSTD uintmax_t;
using _CSTD uintptr_t;
using _CSTD intptr_t;
using _CSTD int_fast8_t; using _CSTD int_fast16_t;
using _CSTD int_fast32_t; using _CSTD int_fast64_t;
using _CSTD uint_fast8_t; using _CSTD uint_fast16_t;
using _CSTD uint_fast32_t; using _CSTD uint_fast64_t;
#endif /* defined(_STD_USING) */
/*
* Copyright (c) 1992-2009 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
V5.04:0576 */