Subversion Repositories Kolibri OS

Rev

Rev 4930 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4930 Rev 6099
Line 8... Line 8...
8
 
8
 
9
#ifndef _STDINT_H
9
#ifndef _STDINT_H
Line 10... Line 10...
10
#define _STDINT_H
10
#define _STDINT_H
-
 
11
 
-
 
12
#include 
Line 11... Line 13...
11
 
13
#include 
12
#include 
14
#include 
13
 
15
 
Line 14... Line -...
14
#ifdef __cplusplus
-
 
15
extern "C" {
-
 
16
#endif
-
 
17
 
-
 
18
#if __GNUC_PREREQ (3, 2)
-
 
19
/* gcc > 3.2 implicitly defines the values we are interested */
-
 
20
#define __STDINT_EXP(x) __##x##__
-
 
21
#else
-
 
22
#define __STDINT_EXP(x) x
-
 
23
#include 
-
 
24
#endif
-
 
25
 
-
 
26
/* Check if "long long" is 64bit wide */
-
 
27
/* Modern GCCs provide __LONG_LONG_MAX__, SUSv3 wants LLONG_MAX */
-
 
28
#if ( defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff) ) \
-
 
29
  || ( defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff) )
-
 
30
#define __have_longlong64 1
-
 
31
#endif
-
 
32
 
-
 
33
/* Check if "long" is 64bit or 32bit wide */
-
 
34
#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
-
 
35
#define __have_long64 1
-
 
36
#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
-
 
37
#define __have_long32 1
-
 
38
#define __have_long64 0
-
 
39
#endif
-
 
40
 
-
 
41
#ifdef ___int8_t_defined
-
 
42
typedef __int8_t int8_t ;
-
 
43
typedef __uint8_t uint8_t ;
16
#ifdef __cplusplus
44
#define __int8_t_defined 1
17
extern "C" {
45
#endif
18
#endif
46
 
19
 
47
#ifdef ___int_least8_t_defined
20
#ifdef ___int_least8_t_defined
Line 48... Line -...
48
typedef __int_least8_t int_least8_t;
-
 
49
typedef __uint_least8_t uint_least8_t;
-
 
50
#define __int_least8_t_defined 1
-
 
51
#endif
-
 
52
 
-
 
53
#ifdef ___int16_t_defined
-
 
54
typedef __int16_t int16_t ;
21
typedef __int_least8_t int_least8_t;
55
typedef __uint16_t uint16_t ;
22
typedef __uint_least8_t uint_least8_t;
56
#define __int16_t_defined 1
23
#define __int_least8_t_defined 1
57
#endif
24
#endif
58
 
25
 
Line 59... Line -...
59
#ifdef ___int_least16_t_defined
-
 
60
typedef __int_least16_t int_least16_t;
-
 
61
typedef __uint_least16_t uint_least16_t;
-
 
62
#define __int_least16_t_defined 1
-
 
63
#endif
-
 
64
 
-
 
65
#ifdef ___int32_t_defined
26
#ifdef ___int_least16_t_defined
66
typedef __int32_t int32_t ;
27
typedef __int_least16_t int_least16_t;
67
typedef __uint32_t uint32_t ;
28
typedef __uint_least16_t uint_least16_t;
68
#define __int32_t_defined 1
29
#define __int_least16_t_defined 1
69
#endif
30
#endif
Line 70... Line -...
70
 
-
 
71
#ifdef ___int_least32_t_defined
-
 
72
typedef __int_least32_t int_least32_t;
-
 
73
typedef __uint_least32_t uint_least32_t;
-
 
74
#define __int_least32_t_defined 1
-
 
75
#endif
-
 
76
 
31
 
77
#ifdef ___int64_t_defined
32
#ifdef ___int_least32_t_defined
78
typedef __int64_t int64_t ;
33
typedef __int_least32_t int_least32_t;
79
typedef __uint64_t uint64_t ;
34
typedef __uint_least32_t uint_least32_t;
80
#define __int64_t_defined 1
35
#define __int_least32_t_defined 1
Line 186... Line 141...
186
  typedef unsigned long long uintmax_t;
141
  typedef unsigned long long uintmax_t;
187
#else
142
#else
188
  typedef unsigned long uintmax_t;
143
  typedef unsigned long uintmax_t;
189
#endif
144
#endif
Line 190... Line -...
190
 
-
 
191
typedef __intptr_t intptr_t;
-
 
192
typedef __uintptr_t uintptr_t;
-
 
193
 
145
 
194
#ifdef __INTPTR_TYPE__
146
#ifdef __INTPTR_TYPE__
195
#define INTPTR_MIN (-__INTPTR_MAX__ - 1)
147
#define INTPTR_MIN (-__INTPTR_MAX__ - 1)
196
#define INTPTR_MAX __INTPTR_MAX__
148
#define INTPTR_MAX (__INTPTR_MAX__)
197
#define UINTPTR_MAX __UINTPTR_MAX__
149
#define UINTPTR_MAX (__UINTPTR_MAX__)
198
#elif defined(__PTRDIFF_TYPE__)
150
#elif defined(__PTRDIFF_TYPE__)
199
#define INTPTR_MAX PTRDIFF_MAX
151
#define INTPTR_MAX PTRDIFF_MAX
200
#define INTPTR_MIN PTRDIFF_MIN
152
#define INTPTR_MIN PTRDIFF_MIN
201
#ifdef __UINTPTR_MAX__
153
#ifdef __UINTPTR_MAX__
202
#define UINTPTR_MAX __UINTPTR_MAX__
154
#define UINTPTR_MAX (__UINTPTR_MAX__)
203
#else
155
#else
204
#define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1)
156
#define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1)
205
#endif
157
#endif
206
#else
158
#else
207
/*
159
/*
208
 * Fallback to hardcoded values,
160
 * Fallback to hardcoded values, 
209
 * should be valid on cpu's with 32bit int/32bit void*
161
 * should be valid on cpu's with 32bit int/32bit void*
210
 */
162
 */
211
#define INTPTR_MAX __STDINT_EXP(LONG_MAX)
163
#define INTPTR_MAX (__STDINT_EXP(LONG_MAX))
212
#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
164
#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
213
#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
165
#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
Line 214... Line 166...
214
#endif
166
#endif
Line 215... Line 167...
215
 
167
 
216
/* Limits of Specified-Width Integer Types */
168
/* Limits of Specified-Width Integer Types */
217
 
169
 
218
#ifdef __INT8_MAX__
170
#ifdef __INT8_MAX__
219
#define INT8_MIN (-__INT8_MAX__ - 1)
171
#define INT8_MIN (-__INT8_MAX__ - 1)
220
#define INT8_MAX __INT8_MAX__
172
#define INT8_MAX (__INT8_MAX__)
221
#define UINT8_MAX __UINT8_MAX__
173
#define UINT8_MAX (__UINT8_MAX__)
222
#elif defined(__int8_t_defined)
174
#elif defined(__int8_t_defined)
223
#define INT8_MIN 	-128
175
#define INT8_MIN 	(-128)
Line 224... Line 176...
224
#define INT8_MAX 	 127
176
#define INT8_MAX 	 (127)
225
#define UINT8_MAX 	 255
177
#define UINT8_MAX 	 (255)
226
#endif
178
#endif
227
 
179
 
228
#ifdef __INT_LEAST8_MAX__
180
#ifdef __INT_LEAST8_MAX__
229
#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1)
181
#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1)
230
#define INT_LEAST8_MAX __INT_LEAST8_MAX__
182
#define INT_LEAST8_MAX (__INT_LEAST8_MAX__)
231
#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
183
#define UINT_LEAST8_MAX (__UINT_LEAST8_MAX__)
232
#elif defined(__int_least8_t_defined)
184
#elif defined(__int_least8_t_defined)
233
#define INT_LEAST8_MIN 	-128
185
#define INT_LEAST8_MIN 	(-128)
234
#define INT_LEAST8_MAX 	 127
186
#define INT_LEAST8_MAX 	 (127)
Line 235... Line 187...
235
#define UINT_LEAST8_MAX	 255
187
#define UINT_LEAST8_MAX	 (255)
236
#else
188
#else
237
#error required type int_least8_t missing
189
#error required type int_least8_t missing
238
#endif
190
#endif
239
 
191
 
240
#ifdef __INT16_MAX__
192
#ifdef __INT16_MAX__
241
#define INT16_MIN (-__INT16_MAX__ - 1)
193
#define INT16_MIN (-__INT16_MAX__ - 1)
242
#define INT16_MAX __INT16_MAX__
194
#define INT16_MAX (__INT16_MAX__)
243
#define UINT16_MAX __UINT16_MAX__
195
#define UINT16_MAX (__UINT16_MAX__)
Line 244... Line 196...
244
#elif defined(__int16_t_defined)
196
#elif defined(__int16_t_defined)
245
#define INT16_MIN 	-32768
197
#define INT16_MIN 	(-32768)
246
#define INT16_MAX 	 32767
198
#define INT16_MAX 	 (32767)
247
#define UINT16_MAX 	 65535
199
#define UINT16_MAX 	 (65535)
248
#endif
200
#endif
249
 
201
 
250
#ifdef __INT_LEAST16_MAX__
202
#ifdef __INT_LEAST16_MAX__
251
#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1)
203
#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1)
252
#define INT_LEAST16_MAX __INT_LEAST16_MAX__
204
#define INT_LEAST16_MAX (__INT_LEAST16_MAX__)
253
#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
205
#define UINT_LEAST16_MAX (__UINT_LEAST16_MAX__)
254
#elif defined(__int_least16_t_defined)
206
#elif defined(__int_least16_t_defined)
Line 255... Line 207...
255
#define INT_LEAST16_MIN	-32768
207
#define INT_LEAST16_MIN	(-32768)
256
#define INT_LEAST16_MAX	 32767
208
#define INT_LEAST16_MAX	 (32767)
257
#define UINT_LEAST16_MAX 65535
209
#define UINT_LEAST16_MAX (65535)
258
#else
210
#else
259
#error required type int_least16_t missing
211
#error required type int_least16_t missing
260
#endif
212
#endif
261
 
213
 
262
#ifdef __INT32_MAX__
214
#ifdef __INT32_MAX__
263
#define INT32_MIN (-__INT32_MAX__ - 1)
215
#define INT32_MIN (-__INT32_MAX__ - 1)
264
#define INT32_MAX __INT32_MAX__
216
#define INT32_MAX (__INT32_MAX__)
265
#define UINT32_MAX __UINT32_MAX__
217
#define UINT32_MAX (__UINT32_MAX__)
266
#elif defined(__int32_t_defined)
218
#elif defined(__int32_t_defined)
267
#if __have_long32
219
#if defined (_INT32_EQ_LONG)
268
#define INT32_MIN 	 (-2147483647L-1)
220
#define INT32_MIN 	 (-2147483647L-1)
269
#define INT32_MAX 	 2147483647L
221
#define INT32_MAX 	 (2147483647L)
Line 270... Line 222...
270
#define UINT32_MAX       4294967295UL
222
#define UINT32_MAX       (4294967295UL)
271
#else
223
#else
272
#define INT32_MIN 	 (-2147483647-1)
224
#define INT32_MIN 	 (-2147483647-1)
273
#define INT32_MAX 	 2147483647
225
#define INT32_MAX 	 (2147483647)
274
#define UINT32_MAX       4294967295U
226
#define UINT32_MAX       (4294967295U)
275
#endif
227
#endif
276
#endif
228
#endif
277
 
229
 
278
#ifdef __INT_LEAST32_MAX__
230
#ifdef __INT_LEAST32_MAX__
279
#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1)
231
#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1)
280
#define INT_LEAST32_MAX __INT_LEAST32_MAX__
232
#define INT_LEAST32_MAX (__INT_LEAST32_MAX__)
281
#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
233
#define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__)
282
#elif defined(__int_least32_t_defined)
234
#elif defined(__int_least32_t_defined)
283
#if __have_long32
235
#if defined (_INT32_EQ_LONG)
284
#define INT_LEAST32_MIN  (-2147483647L-1)
236
#define INT_LEAST32_MIN  (-2147483647L-1)
285
#define INT_LEAST32_MAX  2147483647L
237
#define INT_LEAST32_MAX  (2147483647L)
286
#define UINT_LEAST32_MAX 4294967295UL
238
#define UINT_LEAST32_MAX (4294967295UL)
Line 287... Line 239...
287
#else
239
#else
288
#define INT_LEAST32_MIN  (-2147483647-1)
240
#define INT_LEAST32_MIN  (-2147483647-1)
289
#define INT_LEAST32_MAX  2147483647
241
#define INT_LEAST32_MAX  (2147483647)
290
#define UINT_LEAST32_MAX 4294967295U
242
#define UINT_LEAST32_MAX (4294967295U)
291
#endif
243
#endif
292
#else
244
#else
293
#error required type int_least32_t missing
245
#error required type int_least32_t missing
294
#endif
246
#endif
295
 
247
 
296
#ifdef __INT64_MAX__
248
#ifdef __INT64_MAX__
297
#define INT64_MIN (-__INT64_MAX__ - 1)
249
#define INT64_MIN (-__INT64_MAX__ - 1)
298
#define INT64_MAX __INT64_MAX__
250
#define INT64_MAX (__INT64_MAX__)
299
#define UINT64_MAX __UINT64_MAX__
251
#define UINT64_MAX (__UINT64_MAX__)
300
#elif defined(__int64_t_defined)
252
#elif defined(__int64_t_defined)
301
#if __have_long64
253
#if __have_long64
Line 302... Line 254...
302
#define INT64_MIN 	(-9223372036854775807L-1L)
254
#define INT64_MIN 	(-9223372036854775807L-1L)
303
#define INT64_MAX 	 9223372036854775807L
255
#define INT64_MAX 	 (9223372036854775807L)
304
#define UINT64_MAX 	18446744073709551615U
256
#define UINT64_MAX 	(18446744073709551615U)
305
#elif __have_longlong64
257
#elif __have_longlong64
306
#define INT64_MIN 	(-9223372036854775807LL-1LL)
258
#define INT64_MIN 	(-9223372036854775807LL-1LL)
307
#define INT64_MAX 	 9223372036854775807LL
259
#define INT64_MAX 	 (9223372036854775807LL)
308
#define UINT64_MAX 	18446744073709551615ULL
260
#define UINT64_MAX 	(18446744073709551615ULL)
309
#endif
261
#endif
310
#endif
262
#endif
311
 
263
 
312
#ifdef __INT_LEAST64_MAX__
264
#ifdef __INT_LEAST64_MAX__
313
#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1)
265
#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1)
314
#define INT_LEAST64_MAX __INT_LEAST64_MAX__
266
#define INT_LEAST64_MAX (__INT_LEAST64_MAX__)
315
#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
267
#define UINT_LEAST64_MAX (__UINT_LEAST64_MAX__)
316
#elif defined(__int_least64_t_defined)
268
#elif defined(__int_least64_t_defined)
Line 317... Line 269...
317
#if __have_long64
269
#if __have_long64
318
#define INT_LEAST64_MIN  (-9223372036854775807L-1L)
270
#define INT_LEAST64_MIN  (-9223372036854775807L-1L)
319
#define INT_LEAST64_MAX  9223372036854775807L
271
#define INT_LEAST64_MAX  (9223372036854775807L)
320
#define UINT_LEAST64_MAX 18446744073709551615U
272
#define UINT_LEAST64_MAX (18446744073709551615U)
321
#elif __have_longlong64
273
#elif __have_longlong64
322
#define INT_LEAST64_MIN  (-9223372036854775807LL-1LL)
274
#define INT_LEAST64_MIN  (-9223372036854775807LL-1LL)
323
#define INT_LEAST64_MAX  9223372036854775807LL
275
#define INT_LEAST64_MAX  (9223372036854775807LL)
324
#define UINT_LEAST64_MAX 18446744073709551615ULL
276
#define UINT_LEAST64_MAX (18446744073709551615ULL)
325
#endif
277
#endif
326
#endif
278
#endif
327
 
279
 
328
#ifdef __INT_FAST8_MAX__
280
#ifdef __INT_FAST8_MAX__
329
#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1)
281
#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1)
330
#define INT_FAST8_MAX __INT_FAST8_MAX__
282
#define INT_FAST8_MAX (__INT_FAST8_MAX__)
331
#define UINT_FAST8_MAX __UINT_FAST8_MAX__
283
#define UINT_FAST8_MAX (__UINT_FAST8_MAX__)
Line 332... Line 284...
332
#elif defined(__int_fast8_t_defined)
284
#elif defined(__int_fast8_t_defined)
333
#if __STDINT_EXP(INT_MAX) >= 0x7f
285
#if __STDINT_EXP(INT_MAX) >= 0x7f
334
#define INT_FAST8_MIN	(-__STDINT_EXP(INT_MAX)-1)
286
#define INT_FAST8_MIN	(-__STDINT_EXP(INT_MAX)-1)
335
#define INT_FAST8_MAX	__STDINT_EXP(INT_MAX)
287
#define INT_FAST8_MAX	(__STDINT_EXP(INT_MAX))
336
#define UINT_FAST8_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
288
#define UINT_FAST8_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
337
#else
289
#else
338
#define INT_FAST8_MIN	INT_LEAST8_MIN
290
#define INT_FAST8_MIN	INT_LEAST8_MIN
339
#define INT_FAST8_MAX	INT_LEAST8_MAX
291
#define INT_FAST8_MAX	INT_LEAST8_MAX
340
#define UINT_FAST8_MAX	UINT_LEAST8_MAX
292
#define UINT_FAST8_MAX	UINT_LEAST8_MAX
341
#endif
293
#endif
342
#endif
294
#endif
343
 
295
 
344
#ifdef __INT_FAST16_MAX__
296
#ifdef __INT_FAST16_MAX__
345
#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1)
297
#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1)
346
#define INT_FAST16_MAX __INT_FAST16_MAX__
298
#define INT_FAST16_MAX (__INT_FAST16_MAX__)
Line 347... Line 299...
347
#define UINT_FAST16_MAX __UINT_FAST16_MAX__
299
#define UINT_FAST16_MAX (__UINT_FAST16_MAX__)
348
#elif defined(__int_fast16_t_defined)
300
#elif defined(__int_fast16_t_defined)
349
#if __STDINT_EXP(INT_MAX) >= 0x7fff
301
#if __STDINT_EXP(INT_MAX) >= 0x7fff
350
#define INT_FAST16_MIN	(-__STDINT_EXP(INT_MAX)-1)
302
#define INT_FAST16_MIN	(-__STDINT_EXP(INT_MAX)-1)
351
#define INT_FAST16_MAX	__STDINT_EXP(INT_MAX)
303
#define INT_FAST16_MAX	(__STDINT_EXP(INT_MAX))
352
#define UINT_FAST16_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
304
#define UINT_FAST16_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
353
#else
305
#else
354
#define INT_FAST16_MIN	INT_LEAST16_MIN
306
#define INT_FAST16_MIN	INT_LEAST16_MIN
355
#define INT_FAST16_MAX	INT_LEAST16_MAX
307
#define INT_FAST16_MAX	INT_LEAST16_MAX
356
#define UINT_FAST16_MAX	UINT_LEAST16_MAX
308
#define UINT_FAST16_MAX	UINT_LEAST16_MAX
357
#endif
309
#endif
358
#endif
310
#endif
359
 
311
 
360
#ifdef __INT_FAST32_MAX__
312
#ifdef __INT_FAST32_MAX__
361
#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1)
313
#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1)
Line 362... Line 314...
362
#define INT_FAST32_MAX __INT_FAST32_MAX__
314
#define INT_FAST32_MAX (__INT_FAST32_MAX__)
363
#define UINT_FAST32_MAX __UINT_FAST32_MAX__
315
#define UINT_FAST32_MAX (__UINT_FAST32_MAX__)
364
#elif defined(__int_fast32_t_defined)
316
#elif defined(__int_fast32_t_defined)
365
#if __STDINT_EXP(INT_MAX) >= 0x7fffffff
317
#if __STDINT_EXP(INT_MAX) >= 0x7fffffff
366
#define INT_FAST32_MIN	(-__STDINT_EXP(INT_MAX)-1)
318
#define INT_FAST32_MIN	(-__STDINT_EXP(INT_MAX)-1)
367
#define INT_FAST32_MAX	__STDINT_EXP(INT_MAX)
319
#define INT_FAST32_MAX	(__STDINT_EXP(INT_MAX))
368
#define UINT_FAST32_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
320
#define UINT_FAST32_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
369
#else
321
#else
370
#define INT_FAST32_MIN	INT_LEAST32_MIN
322
#define INT_FAST32_MIN	INT_LEAST32_MIN
371
#define INT_FAST32_MAX	INT_LEAST32_MAX
323
#define INT_FAST32_MAX	INT_LEAST32_MAX
372
#define UINT_FAST32_MAX	UINT_LEAST32_MAX
324
#define UINT_FAST32_MAX	UINT_LEAST32_MAX
373
#endif
325
#endif
374
#endif
326
#endif
375
 
327
 
376
#ifdef __INT_FAST64_MAX__
328
#ifdef __INT_FAST64_MAX__
Line 377... Line 329...
377
#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1)
329
#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1)
378
#define INT_FAST64_MAX __INT_FAST64_MAX__
330
#define INT_FAST64_MAX (__INT_FAST64_MAX__)
379
#define UINT_FAST64_MAX __UINT_FAST64_MAX__
331
#define UINT_FAST64_MAX (__UINT_FAST64_MAX__)
380
#elif defined(__int_fast64_t_defined)
332
#elif defined(__int_fast64_t_defined)
381
#if __STDINT_EXP(INT_MAX) > 0x7fffffff
333
#if __STDINT_EXP(INT_MAX) > 0x7fffffff
382
#define INT_FAST64_MIN	(-__STDINT_EXP(INT_MAX)-1)
334
#define INT_FAST64_MIN	(-__STDINT_EXP(INT_MAX)-1)
383
#define INT_FAST64_MAX	__STDINT_EXP(INT_MAX)
335
#define INT_FAST64_MAX	(__STDINT_EXP(INT_MAX))
384
#define UINT_FAST64_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
336
#define UINT_FAST64_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
Line 385... Line 337...
385
#else
337
#else
386
#define INT_FAST64_MIN	INT_LEAST64_MIN
338
#define INT_FAST64_MIN	INT_LEAST64_MIN
387
#define INT_FAST64_MAX	INT_LEAST64_MAX
339
#define INT_FAST64_MAX	INT_LEAST64_MAX
388
#define UINT_FAST64_MAX	UINT_LEAST64_MAX
340
#define UINT_FAST64_MAX	UINT_LEAST64_MAX
389
#endif
341
#endif
390
#endif
342
#endif
Line 391... Line 343...
391
 
343
 
392
#ifdef __INTMAX_MAX__
344
#ifdef __INTMAX_MAX__
393
#define INTMAX_MAX __INTMAX_MAX__
345
#define INTMAX_MAX (__INTMAX_MAX__)
394
#define INTMAX_MIN (-INTMAX_MAX - 1)
346
#define INTMAX_MIN (-INTMAX_MAX - 1)
395
#elif defined(__INTMAX_TYPE__)
347
#elif defined(__INTMAX_TYPE__)
396
/* All relevant GCC versions prefer long to long long for intmax_t.  */
348
/* All relevant GCC versions prefer long to long long for intmax_t.  */
Line 397... Line 349...
397
#define INTMAX_MAX INT64_MAX
349
#define INTMAX_MAX INT64_MAX
398
#define INTMAX_MIN INT64_MIN
350
#define INTMAX_MIN INT64_MIN
399
#endif
351
#endif
Line 400... Line 352...
400
 
352
 
401
#ifdef __UINTMAX_MAX__
353
#ifdef __UINTMAX_MAX__
402
#define UINTMAX_MAX __UINTMAX_MAX__
354
#define UINTMAX_MAX (__UINTMAX_MAX__)
403
#elif defined(__UINTMAX_TYPE__)
355
#elif defined(__UINTMAX_TYPE__)
404
/* All relevant GCC versions prefer long to long long for intmax_t.  */
356
/* All relevant GCC versions prefer long to long long for intmax_t.  */
405
#define UINTMAX_MAX UINT64_MAX
357
#define UINTMAX_MAX UINT64_MAX
406
#endif
358
#endif
Line -... Line 359...
-
 
359
 
-
 
360
/* This must match size_t in stddef.h, currently long unsigned int */
-
 
361
#ifdef __SIZE_MAX__
-
 
362
#define SIZE_MAX (__SIZE_MAX__)
-
 
363
#else
-
 
364
#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
-
 
365
#endif
-
 
366
 
-
 
367
/* This must match sig_atomic_t in  (currently int) */
-
 
368
#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1)
-
 
369
#define SIG_ATOMIC_MAX (__STDINT_EXP(INT_MAX))
-
 
370
 
-
 
371
/* This must match ptrdiff_t  in  (currently long int) */
407
 
372
#ifdef __PTRDIFF_MAX__
408
/* This must match size_t in stddef.h, currently long unsigned int */
373
#define PTRDIFF_MAX (__PTRDIFF_MAX__)
-
 
374
#else
-
 
375
#define PTRDIFF_MAX (__STDINT_EXP(LONG_MAX))
-
 
376
#endif
-
 
377
#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
409
#ifdef __SIZE_MAX__
378
 
410
#define SIZE_MAX __SIZE_MAX__
-
 
411
#else
-
 
412
#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
379
/* This must match definition in  */
Line 413... Line 380...
413
#endif
380
#ifndef WCHAR_MIN
414
 
381
#ifdef __WCHAR_MIN__
415
/* This must match sig_atomic_t in  (currently int) */
382
#define WCHAR_MIN (__WCHAR_MIN__)
416
#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1)
383
#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0)
417
#define SIG_ATOMIC_MAX __STDINT_EXP(INT_MAX)
384
#define WCHAR_MIN (0 + L'\0')
418
 
385
#else
419
/* This must match ptrdiff_t  in  (currently long int) */
386
#define WCHAR_MIN (-0x7fffffff - 1 + L'\0')
420
#ifdef __PTRDIFF_MAX__
387
#endif
421
#define PTRDIFF_MAX __PTRDIFF_MAX__
388
#endif
422
#else
389
 
423
#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX)
390
/* This must match definition in  */
Line 424... Line 391...
424
#endif
391
#ifndef WCHAR_MAX
425
#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
392
#ifdef __WCHAR_MAX__
426
 
393
#define WCHAR_MAX (__WCHAR_MAX__)
Line 470... Line 437...
470
 
437
 
471
#ifdef __INT32_C
438
#ifdef __INT32_C
472
#define INT32_C(x) __INT32_C(x)
439
#define INT32_C(x) __INT32_C(x)
473
#define UINT32_C(x) __UINT32_C(x)
440
#define UINT32_C(x) __UINT32_C(x)
474
#else
441
#else
475
#if __have_long32
442
#if defined (_INT32_EQ_LONG)
476
#define INT32_C(x)	x##L
443
#define INT32_C(x)	x##L
477
#define UINT32_C(x)	x##UL
444
#define UINT32_C(x)	x##UL
478
#else
445
#else
479
#define INT32_C(x)	x
446
#define INT32_C(x)	x