Subversion Repositories Kolibri OS

Rev

Rev 4874 | Rev 4930 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4874 Rev 4921
Line 7... Line 7...
7
 */
7
 */
Line 8... Line 8...
8
 
8
 
9
#ifndef _STDINT_H
9
#ifndef _STDINT_H
Line -... Line 10...
-
 
10
#define _STDINT_H
-
 
11
 
10
#define _STDINT_H
12
#include 
11
 
13
 
12
#ifdef __cplusplus
14
#ifdef __cplusplus
Line 13... Line -...
13
extern "C" {
-
 
14
#endif
15
extern "C" {
15
 
-
 
16
#if defined(__GNUC__) && \
16
#endif
17
  ( (__GNUC__ >= 4) || \
17
 
18
    ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2) ) )
18
#if __GNUC_PREREQ (3, 2)
19
/* gcc > 3.2 implicitly defines the values we are interested */
19
/* gcc > 3.2 implicitly defines the values we are interested */
20
#define __STDINT_EXP(x) __##x##__
20
#define __STDINT_EXP(x) __##x##__
Line 33... Line 33...
33
/* Check if "long" is 64bit or 32bit wide */
33
/* Check if "long" is 64bit or 32bit wide */
34
#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
34
#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
35
#define __have_long64 1
35
#define __have_long64 1
36
#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
36
#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
37
#define __have_long32 1
37
#define __have_long32 1
38
#define __have_long64 0
-
 
39
#endif
38
#endif
Line 40... Line 39...
40
 
39
 
41
#if __STDINT_EXP(SCHAR_MAX) == 0x7f
40
#ifdef ___int8_t_defined
42
typedef signed char int8_t ;
41
typedef __int8_t int8_t ;
43
typedef unsigned char uint8_t ;
42
typedef __uint8_t uint8_t ;
44
#define __int8_t_defined 1
43
#define __int8_t_defined 1
Line 45... Line 44...
45
#endif
44
#endif
46
 
45
 
47
#if __int8_t_defined
46
#ifdef ___int_least8_t_defined
48
typedef signed char int_least8_t;
47
typedef __int_least8_t int_least8_t;
49
typedef unsigned char uint_least8_t;
48
typedef __uint_least8_t uint_least8_t;
Line 50... Line -...
50
#define __int_least8_t_defined 1
-
 
51
#endif
-
 
52
 
-
 
53
#if __STDINT_EXP(SHRT_MAX) == 0x7fff
49
#define __int_least8_t_defined 1
54
typedef signed short int16_t;
-
 
55
typedef unsigned short uint16_t;
50
#endif
56
#define __int16_t_defined 1
51
 
57
#elif __STDINT_EXP(INT_MAX) == 0x7fff
-
 
58
typedef signed int int16_t;
-
 
59
typedef unsigned int uint16_t;
-
 
60
#define __int16_t_defined 1
-
 
61
#elif __STDINT_EXP(SCHAR_MAX) == 0x7fff
52
#ifdef ___int16_t_defined
62
typedef signed char int16_t;
53
typedef __int16_t int16_t ;
Line 63... Line 54...
63
typedef unsigned char uint16_t;
54
typedef __uint16_t uint16_t ;
64
#define __int16_t_defined 1
55
#define __int16_t_defined 1
65
#endif
56
#endif
66
 
57
 
67
#if __int16_t_defined
-
 
68
typedef int16_t   	int_least16_t;
-
 
69
typedef uint16_t 	uint_least16_t;
-
 
70
#define __int_least16_t_defined 1
-
 
71
 
-
 
72
#if !__int_least8_t_defined
-
 
73
typedef int16_t	   	int_least8_t;
58
#ifdef ___int_least16_t_defined
Line 74... Line -...
74
typedef uint16_t  	uint_least8_t;
-
 
75
#define __int_least8_t_defined 1
-
 
76
#endif
-
 
77
#endif
59
typedef __int_least16_t int_least16_t;
78
 
-
 
79
//#if __have_long32
60
typedef __uint_least16_t uint_least16_t;
80
//typedef signed long int32_t;
61
#define __int_least16_t_defined 1
81
//typedef unsigned long uint32_t;
62
#endif
82
//#define __int32_t_defined 1
-
 
83
//#elif __STDINT_EXP(INT_MAX) == 0x7fffffffL
-
 
84
typedef signed int int32_t;
-
 
85
typedef unsigned int uint32_t;
-
 
86
#define __int32_t_defined 1
-
 
87
//#elif __STDINT_EXP(SHRT_MAX) == 0x7fffffffL
-
 
88
//typedef signed short int32_t;
-
 
89
//typedef unsigned short uint32_t;
-
 
90
//#define __int32_t_defined 1
-
 
91
//#elif __STDINT_EXP(SCHAR_MAX) == 0x7fffffffL
-
 
92
//typedef signed char int32_t;
-
 
93
//typedef unsigned char uint32_t;
-
 
94
//#define __int32_t_defined 1
-
 
95
//#endif
-
 
96
 
-
 
97
#if __int32_t_defined
-
 
98
typedef int32_t   	int_least32_t;
-
 
99
typedef uint32_t 	uint_least32_t;
-
 
100
#define __int_least32_t_defined 1
-
 
101
 
63
 
Line 102... Line 64...
102
#if !__int_least8_t_defined
64
#ifdef ___int32_t_defined
103
typedef int32_t	   	int_least8_t;
65
typedef __int32_t int32_t ;
104
typedef uint32_t  	uint_least8_t;
66
typedef __uint32_t uint32_t ;
105
#define __int_least8_t_defined 1
67
#define __int32_t_defined 1
106
#endif
-
 
107
 
68
#endif
Line 108... Line -...
108
#if !__int_least16_t_defined
-
 
109
typedef int32_t	   	int_least16_t;
-
 
110
typedef uint32_t  	uint_least16_t;
-
 
111
#define __int_least16_t_defined 1
69
 
112
#endif
-
 
113
#endif
-
 
114
 
-
 
115
#if __have_long64
-
 
116
typedef signed long int64_t;
-
 
117
typedef unsigned long uint64_t;
70
#ifdef ___int_least32_t_defined
118
#define __int64_t_defined 1
71
typedef __int_least32_t int_least32_t;
119
#elif __have_longlong64
72
typedef __uint_least32_t uint_least32_t;
120
typedef signed long long int64_t;
73
#define __int_least32_t_defined 1
Line 121... Line 74...
121
typedef unsigned long long uint64_t;
74
#endif
122
#define __int64_t_defined 1
75
 
123
#elif  __STDINT_EXP(INT_MAX) > 0x7fffffff
76
#ifdef ___int64_t_defined
124
typedef signed int int64_t;
77
typedef __int64_t int64_t ;
125
typedef unsigned int uint64_t;
-
 
126
#define __int64_t_defined 1
-
 
127
#endif
-
 
128
 
-
 
129
#if __int64_t_defined
-
 
130
typedef int64_t   	int_least64_t;
-
 
131
typedef uint64_t 	uint_least64_t;
-
 
132
#define __int_least64_t_defined 1
-
 
133
 
-
 
134
#if !__int_least8_t_defined
-
 
135
typedef int64_t	   	int_least8_t;
-
 
136
typedef uint64_t  	uint_least8_t;
-
 
137
#define __int_least8_t_defined 1
-
 
138
#endif
-
 
139
 
-
 
140
#if !__int_least16_t_defined
-
 
141
typedef int64_t	   	int_least16_t;
-
 
142
typedef uint64_t  	uint_least16_t;
-
 
143
#define __int_least16_t_defined 1
78
typedef __uint64_t uint64_t ;
Line 144... Line 79...
144
#endif
79
#define __int64_t_defined 1
145
 
80
#endif
146
#if !__int_least32_t_defined
81
 
147
typedef int64_t	   	int_least32_t;
82
#ifdef ___int_least64_t_defined
148
typedef uint64_t  	uint_least32_t;
83
typedef __int_least64_t int_least64_t;
149
#define __int_least32_t_defined 1
84
typedef __uint_least64_t uint_least64_t;
-
 
85
#define __int_least64_t_defined 1
-
 
86
#endif
-
 
87
 
-
 
88
/*
150
#endif
89
 * Fastest minimum-width integer types
151
#endif
90
 *
152
 
91
 * Assume int to be the fastest type for all types with a width
153
/*
92
 * less than __INT_MAX__ rsp. INT_MAX
154
 * Fastest minimum-width integer types
93
 */
Line -... Line 94...
-
 
94
#ifdef __INT_FAST8_TYPE__
-
 
95
  typedef __INT_FAST8_TYPE__ int_fast8_t;
-
 
96
  typedef __UINT_FAST8_TYPE__ uint_fast8_t;
-
 
97
#define __int_fast8_t_defined 1
155
 *
98
#elif __STDINT_EXP(INT_MAX) >= 0x7f
156
 * Assume int to be the fastest type for all types with a width
99
  typedef signed int int_fast8_t;
157
 * less than __INT_MAX__ rsp. INT_MAX
100
  typedef unsigned int uint_fast8_t;
158
 */
101
#define __int_fast8_t_defined 1
159
#if __STDINT_EXP(INT_MAX) >= 0x7f
102
#endif
Line -... Line 103...
-
 
103
 
-
 
104
#ifdef __INT_FAST16_TYPE__
-
 
105
  typedef __INT_FAST16_TYPE__ int_fast16_t;
-
 
106
  typedef __UINT_FAST16_TYPE__ uint_fast16_t;
160
  typedef signed int int_fast8_t;
107
#define __int_fast16_t_defined 1
161
  typedef unsigned int uint_fast8_t;
108
#elif __STDINT_EXP(INT_MAX) >= 0x7fff
162
#define __int_fast8_t_defined 1
109
  typedef signed int int_fast16_t;
163
#endif
110
  typedef unsigned int uint_fast16_t;
164
 
111
#define __int_fast16_t_defined 1
Line -... Line 112...
-
 
112
#endif
-
 
113
 
-
 
114
#ifdef __INT_FAST32_TYPE__
-
 
115
  typedef __INT_FAST32_TYPE__ int_fast32_t;
165
#if __STDINT_EXP(INT_MAX) >= 0x7fff
116
  typedef __UINT_FAST32_TYPE__ uint_fast32_t;
166
  typedef signed int int_fast16_t;
117
#define __int_fast32_t_defined 1
167
  typedef unsigned int uint_fast16_t;
118
#elif __STDINT_EXP(INT_MAX) >= 0x7fffffff
168
#define __int_fast16_t_defined 1
119
  typedef signed int int_fast32_t;
169
#endif
-
 
170
 
-
 
171
#if __STDINT_EXP(INT_MAX) >= 0x7fffffff
120
  typedef unsigned int uint_fast32_t;
Line 172... Line 121...
172
  typedef signed int int_fast32_t;
121
#define __int_fast32_t_defined 1
173
  typedef unsigned int uint_fast32_t;
122
#endif
174
#define __int_fast32_t_defined 1
123
 
Line 213... Line 162...
213
 
162
 
214
#if !__int_fast64_t_defined
163
#if !__int_fast64_t_defined
215
#if __int_least64_t_defined
164
#if __int_least64_t_defined
216
  typedef int_least64_t int_fast64_t;
165
  typedef int_least64_t int_fast64_t;
217
  typedef uint_least64_t uint_fast64_t;
-
 
218
#undef  __int_fast64_t_defined
166
  typedef uint_least64_t uint_fast64_t;
219
#define __int_fast64_t_defined 1
167
#define __int_fast64_t_defined 1
220
#endif
168
#endif
Line 221... Line 169...
221
#endif
169
#endif
Line 237... Line 185...
237
  typedef unsigned long long uintmax_t;
185
  typedef unsigned long long uintmax_t;
238
#else
186
#else
239
  typedef unsigned long uintmax_t;
187
  typedef unsigned long uintmax_t;
240
#endif
188
#endif
Line 241... Line -...
241
 
-
 
242
/*
189
 
243
 * GCC doesn't provide an appropriate macro for [u]intptr_t
190
typedef __intptr_t intptr_t;
244
 * For now, use __PTRDIFF_TYPE__
191
typedef __uintptr_t uintptr_t;
245
 */
192
 
246
#if defined(__PTRDIFF_TYPE__)
193
#ifdef __INTPTR_TYPE__
-
 
194
#define INTPTR_MIN (-__INTPTR_MAX__ - 1)
-
 
195
#define INTPTR_MAX __INTPTR_MAX__
247
typedef signed __PTRDIFF_TYPE__ intptr_t;
196
#define UINTPTR_MAX __UINTPTR_MAX__
248
typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
197
#elif defined(__PTRDIFF_TYPE__)
249
#define INTPTR_MAX PTRDIFF_MAX
198
#define INTPTR_MAX PTRDIFF_MAX
250
#define INTPTR_MIN PTRDIFF_MIN
199
#define INTPTR_MIN PTRDIFF_MIN
251
#ifdef __UINTPTR_MAX__
200
#ifdef __UINTPTR_MAX__
252
#define UINTPTR_MAX __UINTPTR_MAX__
201
#define UINTPTR_MAX __UINTPTR_MAX__
Line 256... Line 205...
256
#else
205
#else
257
/*
206
/*
258
 * Fallback to hardcoded values,
207
 * Fallback to hardcoded values,
259
 * should be valid on cpu's with 32bit int/32bit void*
208
 * should be valid on cpu's with 32bit int/32bit void*
260
 */
209
 */
261
typedef signed long intptr_t;
-
 
262
typedef unsigned long uintptr_t;
-
 
263
#define INTPTR_MAX __STDINT_EXP(LONG_MAX)
210
#define INTPTR_MAX __STDINT_EXP(LONG_MAX)
264
#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
211
#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
265
#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
212
#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
266
#endif
213
#endif
Line 267... Line 214...
267
 
214
 
Line -... Line 215...
-
 
215
/* Limits of Specified-Width Integer Types */
-
 
216
 
-
 
217
#ifdef __INT8_MAX__
-
 
218
#define INT8_MIN (-__INT8_MAX__ - 1)
268
/* Limits of Specified-Width Integer Types */
219
#define INT8_MAX __INT8_MAX__
269
 
220
#define UINT8_MAX __UINT8_MAX__
270
#if __int8_t_defined
221
#elif defined(__int8_t_defined)
271
#define INT8_MIN 	-128
222
#define INT8_MIN 	-128
272
#define INT8_MAX 	 127
223
#define INT8_MAX 	 127
Line -... Line 224...
-
 
224
#define UINT8_MAX 	 255
-
 
225
#endif
-
 
226
 
-
 
227
#ifdef __INT_LEAST8_MAX__
273
#define UINT8_MAX 	 255
228
#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1)
274
#endif
229
#define INT_LEAST8_MAX __INT_LEAST8_MAX__
275
 
230
#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
276
#if __int_least8_t_defined
231
#elif defined(__int_least8_t_defined)
277
#define INT_LEAST8_MIN 	-128
232
#define INT_LEAST8_MIN 	-128
278
#define INT_LEAST8_MAX 	 127
233
#define INT_LEAST8_MAX 	 127
279
#define UINT_LEAST8_MAX	 255
234
#define UINT_LEAST8_MAX	 255
Line -... Line 235...
-
 
235
#else
-
 
236
#error required type int_least8_t missing
-
 
237
#endif
-
 
238
 
280
#else
239
#ifdef __INT16_MAX__
281
#error required type int_least8_t missing
240
#define INT16_MIN (-__INT16_MAX__ - 1)
282
#endif
241
#define INT16_MAX __INT16_MAX__
283
 
242
#define UINT16_MAX __UINT16_MAX__
284
#if __int16_t_defined
243
#elif defined(__int16_t_defined)
Line -... Line 244...
-
 
244
#define INT16_MIN 	-32768
-
 
245
#define INT16_MAX 	 32767
-
 
246
#define UINT16_MAX 	 65535
-
 
247
#endif
285
#define INT16_MIN 	-32768
248
 
286
#define INT16_MAX 	 32767
249
#ifdef __INT_LEAST16_MAX__
287
#define UINT16_MAX 	 65535
250
#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1)
288
#endif
251
#define INT_LEAST16_MAX __INT_LEAST16_MAX__
289
 
252
#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
290
#if __int_least16_t_defined
253
#elif defined(__int_least16_t_defined)
291
#define INT_LEAST16_MIN	-32768
254
#define INT_LEAST16_MIN	-32768
Line -... Line 255...
-
 
255
#define INT_LEAST16_MAX	 32767
-
 
256
#define UINT_LEAST16_MAX 65535
-
 
257
#else
-
 
258
#error required type int_least16_t missing
292
#define INT_LEAST16_MAX	 32767
259
#endif
293
#define UINT_LEAST16_MAX 65535
260
 
294
#else
261
#ifdef __INT32_MAX__
295
#error required type int_least16_t missing
262
#define INT32_MIN (-__INT32_MAX__ - 1)
296
#endif
263
#define INT32_MAX __INT32_MAX__
297
 
264
#define UINT32_MAX __UINT32_MAX__
Line 305... Line 272...
305
#define INT32_MAX 	 2147483647
272
#define INT32_MAX 	 2147483647
306
#define UINT32_MAX       4294967295U
273
#define UINT32_MAX       4294967295U
307
#endif
274
#endif
308
#endif
275
#endif
Line -... Line 276...
-
 
276
 
-
 
277
#ifdef __INT_LEAST32_MAX__
-
 
278
#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1)
-
 
279
#define INT_LEAST32_MAX __INT_LEAST32_MAX__
309
 
280
#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
310
#if __int_least32_t_defined
281
#elif defined(__int_least32_t_defined)
311
#if __have_long32
282
#if __have_long32
312
#define INT_LEAST32_MIN  (-2147483647L-1)
283
#define INT_LEAST32_MIN  (-2147483647L-1)
313
#define INT_LEAST32_MAX  2147483647L
284
#define INT_LEAST32_MAX  2147483647L
314
#define UINT_LEAST32_MAX 4294967295UL
285
#define UINT_LEAST32_MAX 4294967295UL
Line 319... Line 290...
319
#endif
290
#endif
320
#else
291
#else
321
#error required type int_least32_t missing
292
#error required type int_least32_t missing
322
#endif
293
#endif
Line -... Line 294...
-
 
294
 
-
 
295
#ifdef __INT64_MAX__
-
 
296
#define INT64_MIN (-__INT64_MAX__ - 1)
-
 
297
#define INT64_MAX __INT64_MAX__
323
 
298
#define UINT64_MAX __UINT64_MAX__
324
#if __int64_t_defined
299
#elif defined(__int64_t_defined)
325
#if __have_long64
300
#if __have_long64
326
#define INT64_MIN 	(-9223372036854775807L-1L)
301
#define INT64_MIN 	(-9223372036854775807L-1L)
327
#define INT64_MAX 	 9223372036854775807L
302
#define INT64_MAX 	 9223372036854775807L
328
#define UINT64_MAX 	18446744073709551615U
303
#define UINT64_MAX 	18446744073709551615U
Line 331... Line 306...
331
#define INT64_MAX 	 9223372036854775807LL
306
#define INT64_MAX 	 9223372036854775807LL
332
#define UINT64_MAX 	18446744073709551615ULL
307
#define UINT64_MAX 	18446744073709551615ULL
333
#endif
308
#endif
334
#endif
309
#endif
Line -... Line 310...
-
 
310
 
-
 
311
#ifdef __INT_LEAST64_MAX__
-
 
312
#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1)
-
 
313
#define INT_LEAST64_MAX __INT_LEAST64_MAX__
335
 
314
#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
336
#if __int_least64_t_defined
315
#elif defined(__int_least64_t_defined)
337
#if __have_long64
316
#if __have_long64
338
#define INT_LEAST64_MIN  (-9223372036854775807L-1L)
317
#define INT_LEAST64_MIN  (-9223372036854775807L-1L)
339
#define INT_LEAST64_MAX  9223372036854775807L
318
#define INT_LEAST64_MAX  9223372036854775807L
340
#define UINT_LEAST64_MAX 18446744073709551615U
319
#define UINT_LEAST64_MAX 18446744073709551615U
Line 343... Line 322...
343
#define INT_LEAST64_MAX  9223372036854775807LL
322
#define INT_LEAST64_MAX  9223372036854775807LL
344
#define UINT_LEAST64_MAX 18446744073709551615ULL
323
#define UINT_LEAST64_MAX 18446744073709551615ULL
345
#endif
324
#endif
346
#endif
325
#endif
Line -... Line 326...
-
 
326
 
-
 
327
#ifdef __INT_FAST8_MAX__
-
 
328
#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1)
-
 
329
#define INT_FAST8_MAX __INT_FAST8_MAX__
347
 
330
#define UINT_FAST8_MAX __UINT_FAST8_MAX__
348
#if __int_fast8_t_defined
331
#elif defined(__int_fast8_t_defined)
349
#if __STDINT_EXP(INT_MAX) >= 0x7f
332
#if __STDINT_EXP(INT_MAX) >= 0x7f
350
#define INT_FAST8_MIN	(-__STDINT_EXP(INT_MAX)-1)
333
#define INT_FAST8_MIN	(-__STDINT_EXP(INT_MAX)-1)
351
#define INT_FAST8_MAX	__STDINT_EXP(INT_MAX)
334
#define INT_FAST8_MAX	__STDINT_EXP(INT_MAX)
352
#define UINT_FAST8_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
335
#define UINT_FAST8_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
Line 355... Line 338...
355
#define INT_FAST8_MAX	INT_LEAST8_MAX
338
#define INT_FAST8_MAX	INT_LEAST8_MAX
356
#define UINT_FAST8_MAX	UINT_LEAST8_MAX
339
#define UINT_FAST8_MAX	UINT_LEAST8_MAX
357
#endif
340
#endif
358
#endif
341
#endif
Line -... Line 342...
-
 
342
 
-
 
343
#ifdef __INT_FAST16_MAX__
-
 
344
#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1)
-
 
345
#define INT_FAST16_MAX __INT_FAST16_MAX__
359
 
346
#define UINT_FAST16_MAX __UINT_FAST16_MAX__
360
#if __int_fast16_t_defined
347
#elif defined(__int_fast16_t_defined)
361
#if __STDINT_EXP(INT_MAX) >= 0x7fff
348
#if __STDINT_EXP(INT_MAX) >= 0x7fff
362
#define INT_FAST16_MIN	(-__STDINT_EXP(INT_MAX)-1)
349
#define INT_FAST16_MIN	(-__STDINT_EXP(INT_MAX)-1)
363
#define INT_FAST16_MAX	__STDINT_EXP(INT_MAX)
350
#define INT_FAST16_MAX	__STDINT_EXP(INT_MAX)
364
#define UINT_FAST16_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
351
#define UINT_FAST16_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
Line 367... Line 354...
367
#define INT_FAST16_MAX	INT_LEAST16_MAX
354
#define INT_FAST16_MAX	INT_LEAST16_MAX
368
#define UINT_FAST16_MAX	UINT_LEAST16_MAX
355
#define UINT_FAST16_MAX	UINT_LEAST16_MAX
369
#endif
356
#endif
370
#endif
357
#endif
Line -... Line 358...
-
 
358
 
-
 
359
#ifdef __INT_FAST32_MAX__
-
 
360
#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1)
-
 
361
#define INT_FAST32_MAX __INT_FAST32_MAX__
371
 
362
#define UINT_FAST32_MAX __UINT_FAST32_MAX__
372
#if __int_fast32_t_defined
363
#elif defined(__int_fast32_t_defined)
373
#if __STDINT_EXP(INT_MAX) >= 0x7fffffff
364
#if __STDINT_EXP(INT_MAX) >= 0x7fffffff
374
#define INT_FAST32_MIN	(-__STDINT_EXP(INT_MAX)-1)
365
#define INT_FAST32_MIN	(-__STDINT_EXP(INT_MAX)-1)
375
#define INT_FAST32_MAX	__STDINT_EXP(INT_MAX)
366
#define INT_FAST32_MAX	__STDINT_EXP(INT_MAX)
376
#define UINT_FAST32_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
367
#define UINT_FAST32_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
Line 379... Line 370...
379
#define INT_FAST32_MAX	INT_LEAST32_MAX
370
#define INT_FAST32_MAX	INT_LEAST32_MAX
380
#define UINT_FAST32_MAX	UINT_LEAST32_MAX
371
#define UINT_FAST32_MAX	UINT_LEAST32_MAX
381
#endif
372
#endif
382
#endif
373
#endif
Line -... Line 374...
-
 
374
 
-
 
375
#ifdef __INT_FAST64_MAX__
-
 
376
#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1)
-
 
377
#define INT_FAST64_MAX __INT_FAST64_MAX__
383
 
378
#define UINT_FAST64_MAX __UINT_FAST64_MAX__
384
#if __int_fast64_t_defined
379
#elif defined(__int_fast64_t_defined)
385
#if __STDINT_EXP(INT_MAX) > 0x7fffffff
380
#if __STDINT_EXP(INT_MAX) > 0x7fffffff
386
#define INT_FAST64_MIN	(-__STDINT_EXP(INT_MAX)-1)
381
#define INT_FAST64_MIN	(-__STDINT_EXP(INT_MAX)-1)
387
#define INT_FAST64_MAX	__STDINT_EXP(INT_MAX)
382
#define INT_FAST64_MAX	__STDINT_EXP(INT_MAX)
388
#define UINT_FAST64_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
383
#define UINT_FAST64_MAX	(__STDINT_EXP(INT_MAX)*2U+1U)
Line 446... Line 441...
446
#else
441
#else
447
#define WINT_MIN 0U
442
#define WINT_MIN 0U
448
#endif
443
#endif
Line 449... Line 444...
449
 
444
 
-
 
445
/** Macros for minimum-width integer constant expressions */
-
 
446
#ifdef __INT8_C
-
 
447
#define INT8_C(x) __INT8_C(x)
-
 
448
#define UINT8_C(x) __UINT8_C(x)
450
/** Macros for minimum-width integer constant expressions */
449
#else
451
#define INT8_C(x)	x
450
#define INT8_C(x)	x
452
#if __STDINT_EXP(INT_MAX) > 0x7f
451
#if __STDINT_EXP(INT_MAX) > 0x7f
453
#define UINT8_C(x)	x
452
#define UINT8_C(x)	x
454
#else
453
#else
455
#define UINT8_C(x)	x##U
454
#define UINT8_C(x)	x##U
-
 
455
#endif
Line -... Line 456...
-
 
456
#endif
-
 
457
 
-
 
458
#ifdef __INT16_C
-
 
459
#define INT16_C(x) __INT16_C(x)
456
#endif
460
#define UINT16_C(x) __UINT16_C(x)
457
 
461
#else
458
#define INT16_C(x)	x
462
#define INT16_C(x)	x
459
#if __STDINT_EXP(INT_MAX) > 0x7fff
463
#if __STDINT_EXP(INT_MAX) > 0x7fff
460
#define UINT16_C(x)	x
464
#define UINT16_C(x)	x
461
#else
465
#else
-
 
466
#define UINT16_C(x)	x##U
Line -... Line 467...
-
 
467
#endif
-
 
468
#endif
-
 
469
 
-
 
470
#ifdef __INT32_C
462
#define UINT16_C(x)	x##U
471
#define INT32_C(x) __INT32_C(x)
463
#endif
472
#define UINT32_C(x) __UINT32_C(x)
464
 
473
#else
465
#if __have_long32
474
#if __have_long32
466
#define INT32_C(x)	x##L
475
#define INT32_C(x)	x##L
467
#define UINT32_C(x)	x##UL
476
#define UINT32_C(x)	x##UL
468
#else
477
#else
-
 
478
#define INT32_C(x)	x
Line -... Line 479...
-
 
479
#define UINT32_C(x)	x##U
-
 
480
#endif
-
 
481
#endif
-
 
482
 
469
#define INT32_C(x)	x
483
#ifdef __INT64_C
470
#define UINT32_C(x)	x##U
484
#define INT64_C(x) __INT64_C(x)
471
#endif
485
#define UINT64_C(x) __UINT64_C(x)
472
 
486
#else
473
#if __int64_t_defined
487
#if __int64_t_defined
474
#if __have_long64
488
#if __have_long64
475
#define INT64_C(x)	x##L
489
#define INT64_C(x)	x##L
476
#define UINT64_C(x)	x##UL
490
#define UINT64_C(x)	x##UL
477
#else
491
#else
-
 
492
#define INT64_C(x)	x##LL
Line 478... Line 493...
478
#define INT64_C(x)	x##LL
493
#define UINT64_C(x)	x##ULL
-
 
494
#endif
-
 
495
#endif
-
 
496
#endif
-
 
497
 
479
#define UINT64_C(x)	x##ULL
498
/** Macros for greatest-width integer constant expression */
480
#endif
499
#ifdef __INTMAX_C
481
#endif
500
#define INTMAX_C(x) __INTMAX_C(x)
482
 
501
#define UINTMAX_C(x) __UINTMAX_C(x)
483
/** Macros for greatest-width integer constant expression */
502
#else
484
#if __have_long64
503
#if __have_long64
485
#define INTMAX_C(x)	x##L
504
#define INTMAX_C(x)	x##L
-
 
505
#define UINTMAX_C(x)	x##UL
Line 486... Line 506...
486
#define UINTMAX_C(x)	x##UL
506
#else
487
#else
507
#define INTMAX_C(x)	x##LL
488
#define INTMAX_C(x)	x##LL
508
#define UINTMAX_C(x)	x##ULL