Subversion Repositories Kolibri OS

Rev

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

Rev 4930 Rev 6099
Line 11... Line 11...
11
 */
11
 */
Line 12... Line 12...
12
 
12
 
13
#ifndef _INTTYPES_H
13
#ifndef _INTTYPES_H
Line -... Line 14...
-
 
14
#define _INTTYPES_H
-
 
15
 
14
#define _INTTYPES_H
16
#include 
15
 
17
#include 
16
#include 
18
#include 
17
#include 
19
#include 
Line 18... Line -...
18
#define __need_wchar_t
-
 
19
#include 
-
 
20
 
-
 
21
/* Don't use __STDINT_EXP test since GCC's stdint.h provides different
-
 
22
   macros than newlib's stdint.h. */
-
 
23
#if __GNUC_PREREQ(3, 2)
-
 
24
  #define __INTTYPES_EXP(x) __##x##__
-
 
25
#else
-
 
26
  #define __INTTYPES_EXP(x) x
-
 
27
  #include 
20
#define __need_wchar_t
Line 28... Line 21...
28
#endif
21
#include 
29
 
22
 
-
 
23
#define __STRINGIFY(a) #a
-
 
24
 
-
 
25
/* 8-bit types */
-
 
26
#define __PRI8(x) __INT8 __STRINGIFY(x)
-
 
27
#define __PRI8LEAST(x) __LEAST8 __STRINGIFY(x)
-
 
28
#define __PRI8FAST(x) __FAST8 __STRINGIFY(x)
-
 
29
 
-
 
30
/* NOTICE: scanning 8-bit types requires use of the hh specifier
-
 
31
 * which is only supported on newlib platforms that
-
 
32
 * are built with C99 I/O format support enabled.  If the flag in
-
 
33
 * newlib.h hasn't been set during configuration to indicate this, the 8-bit
-
 
34
 * scanning format macros are disabled here as they result in undefined
-
 
35
 * behaviour which can include memory overwrite.  Overriding the flag after the
-
 
36
 * library has been built is not recommended as it will expose the underlying
30
#define __STRINGIFY(a) #a
37
 * undefined behaviour.
-
 
38
 */
-
 
39
 
-
 
40
#if defined(_WANT_IO_C99_FORMATS)
Line 31... Line 41...
31
 
41
  #define __SCN8(x) __INT8 __STRINGIFY(x)
32
/* 8-bit types */
42
	#define __SCN8LEAST(x) __LEAST8 __STRINGIFY(x)
33
#define __PRI8(x) __STRINGIFY(x)
43
	#define __SCN8FAST(x) __FAST8 __STRINGIFY(x)
34
#define __SCN8(x) __STRINGIFY(hh##x)
44
#endif /* _WANT_IO_C99_FORMATS */
35
 
45
 
36
 
46
 
Line -... Line 47...
-
 
47
#define PRId8		__PRI8(d)
-
 
48
#define PRIi8		__PRI8(i)
-
 
49
#define PRIo8		__PRI8(o)
37
#define PRId8		__PRI8(d)
50
#define PRIu8		__PRI8(u)
38
#define PRIi8		__PRI8(i)
51
#define PRIx8		__PRI8(x)
39
#define PRIo8		__PRI8(o)
52
#define PRIX8		__PRI8(X)
40
#define PRIu8		__PRI8(u)
53
 
41
#define PRIx8		__PRI8(x)
54
/* Macros below are only enabled for a newlib built with C99 I/O format support. */
Line -... Line 55...
-
 
55
#if defined(_WANT_IO_C99_FORMATS)
-
 
56
 
Line 42... Line 57...
42
#define PRIX8		__PRI8(X)
57
#define SCNd8		__SCN8(d)
43
 
58
#define SCNi8		__SCN8(i)
44
#define SCNd8		__SCN8(d)
59
#define SCNo8		__SCN8(o)
45
#define SCNi8		__SCN8(i)
60
#define SCNu8		__SCN8(u)
46
#define SCNo8		__SCN8(o)
61
#define SCNx8		__SCN8(x)
47
#define SCNu8		__SCN8(u)
62
 
-
 
63
#endif /* _WANT_IO_C99_FORMATS */
-
 
64
 
-
 
65
 
48
#define SCNx8		__SCN8(x)
66
#define PRIdLEAST8	__PRI8LEAST(d)
49
 
67
#define PRIiLEAST8	__PRI8LEAST(i)
50
 
68
#define PRIoLEAST8	__PRI8LEAST(o)
51
#define PRIdLEAST8	__PRI8(d)
69
#define PRIuLEAST8	__PRI8LEAST(u)
52
#define PRIiLEAST8	__PRI8(i)
70
#define PRIxLEAST8	__PRI8LEAST(x)
53
#define PRIoLEAST8	__PRI8(o)
71
#define PRIXLEAST8	__PRI8LEAST(X)
54
#define PRIuLEAST8	__PRI8(u)
72
 
-
 
73
/* Macros below are only enabled for a newlib built with C99 I/O format support. */
55
#define PRIxLEAST8	__PRI8(x)
74
#if defined(_WANT_IO_C99_FORMATS)
56
#define PRIXLEAST8	__PRI8(X)
75
 
57
 
76
  #define SCNdLEAST8	__SCN8LEAST(d)
58
#define SCNdLEAST8	__SCN8(d)
77
  #define SCNiLEAST8	__SCN8LEAST(i)
59
#define SCNiLEAST8	__SCN8(i)
78
  #define SCNoLEAST8	__SCN8LEAST(o)
60
#define SCNoLEAST8	__SCN8(o)
79
  #define SCNuLEAST8	__SCN8LEAST(u)
61
#define SCNuLEAST8	__SCN8(u)
80
  #define SCNxLEAST8	__SCN8LEAST(x)
-
 
81
 
-
 
82
#endif /* _WANT_IO_C99_FORMATS */
-
 
83
 
62
#define SCNxLEAST8	__SCN8(x)
84
#define PRIdFAST8	__PRI8FAST(d)
63
 
85
#define PRIiFAST8	__PRI8FAST(i)
64
 
86
#define PRIoFAST8	__PRI8FAST(o)
65
#define PRIdFAST8	__PRI8(d)
87
#define PRIuFAST8	__PRI8FAST(u)
66
#define PRIiFAST8	__PRI8(i)
88
#define PRIxFAST8	__PRI8FAST(x)
67
#define PRIoFAST8	__PRI8(o)
89
#define PRIXFAST8	__PRI8FAST(X)
-
 
90
 
-
 
91
/* Macros below are only enabled for a newlib built with C99 I/O format support. */
Line 68... Line 92...
68
#define PRIuFAST8	__PRI8(u)
92
#if defined(_WANT_IO_C99_FORMATS)
69
#define PRIxFAST8	__PRI8(x)
93
 
-
 
94
  #define SCNdFAST8	__SCN8FAST(d)
-
 
95
  #define SCNiFAST8	__SCN8FAST(i)
70
#define PRIXFAST8	__PRI8(X)
96
  #define SCNoFAST8	__SCN8FAST(o)
-
 
97
  #define SCNuFAST8	__SCN8FAST(u)
-
 
98
  #define SCNxFAST8	__SCN8FAST(x)
Line 71... Line 99...
71
 
99
 
72
#define SCNdFAST8	__SCN8(d)
100
#endif /* _WANT_IO_C99_FORMATS */
73
#define SCNiFAST8	__SCN8(i)
101
 
Line 92... Line 120...
92
#define SCNo16		__SCN16(o)
120
#define SCNo16		__SCN16(o)
93
#define SCNu16		__SCN16(u)
121
#define SCNu16		__SCN16(u)
94
#define SCNx16		__SCN16(x)
122
#define SCNx16		__SCN16(x)
Line 95... Line 123...
95
 
123
 
96
 
124
 
97
#define PRIdLEAST16	__PRI16(d)
125
#define PRIdLEAST16	__PRI16LEAST(d)
98
#define PRIiLEAST16	__PRI16(i)
126
#define PRIiLEAST16	__PRI16LEAST(i)
99
#define PRIoLEAST16	__PRI16(o)
127
#define PRIoLEAST16	__PRI16LEAST(o)
100
#define PRIuLEAST16	__PRI16(u)
128
#define PRIuLEAST16	__PRI16LEAST(u)
101
#define PRIxLEAST16	__PRI16(x)
129
#define PRIxLEAST16	__PRI16LEAST(x)
102
#define PRIXLEAST16	__PRI16(X)
130
#define PRIXLEAST16	__PRI16LEAST(X)
103
 
131
 
104
#define SCNdLEAST16	__SCN16(d)
132
#define SCNdLEAST16	__SCN16LEAST(d)
105
#define SCNiLEAST16	__SCN16(i)
133
#define SCNiLEAST16	__SCN16LEAST(i)
106
#define SCNoLEAST16	__SCN16(o)
134
#define SCNoLEAST16	__SCN16LEAST(o)
107
#define SCNuLEAST16	__SCN16(u)
135
#define SCNuLEAST16	__SCN16LEAST(u)
108
#define SCNxLEAST16	__SCN16(x)
136
#define SCNxLEAST16	__SCN16LEAST(x)
109
 
137
 
110
 
138
 
111
#define PRIdFAST16	__PRI16(d)
139
#define PRIdFAST16	__PRI16FAST(d)
112
#define PRIiFAST16	__PRI16(i)
140
#define PRIiFAST16	__PRI16FAST(i)
113
#define PRIoFAST16	__PRI16(o)
141
#define PRIoFAST16	__PRI16FAST(o)
114
#define PRIuFAST16	__PRI16(u)
142
#define PRIuFAST16	__PRI16FAST(u)
115
#define PRIxFAST16	__PRI16(x)
143
#define PRIxFAST16	__PRI16FAST(x)
116
#define PRIXFAST16	__PRI16(X)
144
#define PRIXFAST16	__PRI16FAST(X)
117
 
145
 
118
#define SCNdFAST16	__SCN16(d)
146
#define SCNdFAST16	__SCN16FAST(d)
119
#define SCNiFAST16	__SCN16(i)
147
#define SCNiFAST16	__SCN16FAST(i)
120
#define SCNoFAST16	__SCN16(o)
148
#define SCNoFAST16	__SCN16FAST(o)
Line 121... Line 149...
121
#define SCNuFAST16	__SCN16(u)
149
#define SCNuFAST16	__SCN16FAST(u)
122
#define SCNxFAST16	__SCN16(x)
150
#define SCNxFAST16	__SCN16FAST(x)
123
 
151
 
-
 
152
/* 32-bit types */
124
/* 32-bit types */
153
#define __PRI32(x) __INT32 __STRINGIFY(x)
125
#if __have_long32
-
 
126
#define __PRI32(x) __STRINGIFY(l##x)
154
#define __SCN32(x) __INT32 __STRINGIFY(x)
127
#define __SCN32(x) __STRINGIFY(l##x)
155
#define __PRI32LEAST(x) __LEAST32 __STRINGIFY(x)
128
#else
-
 
Line 129... Line 156...
129
#define __PRI32(x) __STRINGIFY(x)
156
#define __SCN32LEAST(x) __LEAST32 __STRINGIFY(x)
130
#define __SCN32(x) __STRINGIFY(x)
157
#define __PRI32FAST(x) __FAST32 __STRINGIFY(x)
131
#endif
158
#define __SCN32FAST(x) __FAST32 __STRINGIFY(x)
132
 
159
 
Line 142... Line 169...
142
#define SCNo32		__SCN32(o)
169
#define SCNo32		__SCN32(o)
143
#define SCNu32		__SCN32(u)
170
#define SCNu32		__SCN32(u)
144
#define SCNx32		__SCN32(x)
171
#define SCNx32		__SCN32(x)
Line 145... Line 172...
145
 
172
 
146
 
173
 
147
#define PRIdLEAST32	__PRI32(d)
174
#define PRIdLEAST32	__PRI32LEAST(d)
148
#define PRIiLEAST32	__PRI32(i)
175
#define PRIiLEAST32	__PRI32LEAST(i)
149
#define PRIoLEAST32	__PRI32(o)
176
#define PRIoLEAST32	__PRI32LEAST(o)
150
#define PRIuLEAST32	__PRI32(u)
177
#define PRIuLEAST32	__PRI32LEAST(u)
151
#define PRIxLEAST32	__PRI32(x)
178
#define PRIxLEAST32	__PRI32LEAST(x)
152
#define PRIXLEAST32	__PRI32(X)
179
#define PRIXLEAST32	__PRI32LEAST(X)
153
 
180
 
154
#define SCNdLEAST32	__SCN32(d)
181
#define SCNdLEAST32	__SCN32LEAST(d)
155
#define SCNiLEAST32	__SCN32(i)
182
#define SCNiLEAST32	__SCN32LEAST(i)
156
#define SCNoLEAST32	__SCN32(o)
183
#define SCNoLEAST32	__SCN32LEAST(o)
157
#define SCNuLEAST32	__SCN32(u)
184
#define SCNuLEAST32	__SCN32LEAST(u)
158
#define SCNxLEAST32	__SCN32(x)
185
#define SCNxLEAST32	__SCN32LEAST(x)
159
 
186
 
160
 
187
 
161
#define PRIdFAST32	__PRI32(d)
188
#define PRIdFAST32	__PRI32FAST(d)
162
#define PRIiFAST32	__PRI32(i)
189
#define PRIiFAST32	__PRI32FAST(i)
163
#define PRIoFAST32	__PRI32(o)
190
#define PRIoFAST32	__PRI32FAST(o)
164
#define PRIuFAST32	__PRI32(u)
191
#define PRIuFAST32	__PRI32FAST(u)
165
#define PRIxFAST32	__PRI32(x)
192
#define PRIxFAST32	__PRI32FAST(x)
166
#define PRIXFAST32	__PRI32(X)
193
#define PRIXFAST32	__PRI32FAST(X)
167
 
194
 
168
#define SCNdFAST32	__SCN32(d)
195
#define SCNdFAST32	__SCN32FAST(d)
169
#define SCNiFAST32	__SCN32(i)
196
#define SCNiFAST32	__SCN32FAST(i)
170
#define SCNoFAST32	__SCN32(o)
197
#define SCNoFAST32	__SCN32FAST(o)
Line 171... Line 198...
171
#define SCNuFAST32	__SCN32(u)
198
#define SCNuFAST32	__SCN32FAST(u)
172
#define SCNxFAST32	__SCN32(x)
-
 
173
 
-
 
174
 
-
 
175
/* 64-bit types */
-
 
176
#if __have_long64
-
 
177
#define __PRI64(x) __STRINGIFY(l##x)
-
 
178
#define __SCN64(x) __STRINGIFY(l##x)
-
 
179
#elif __have_longlong64
199
#define SCNxFAST32	__SCN32FAST(x)
180
#define __PRI64(x) __STRINGIFY(I64##x)
200
 
181
#define __SCN64(x) __STRINGIFY(I64##x)
-
 
Line -... Line 201...
-
 
201
 
-
 
202
/* 64-bit types */
-
 
203
#define __PRI64(x) __INT64 __STRINGIFY(x)
-
 
204
#define __SCN64(x) __INT64 __STRINGIFY(x)
-
 
205
 
-
 
206
#define __PRI64LEAST(x) __LEAST64 __STRINGIFY(x)
182
#else
207
#define __SCN64LEAST(x) __LEAST64 __STRINGIFY(x)
183
#define __PRI64(x) __STRINGIFY(x)
208
#define __PRI64FAST(x) __FAST64 __STRINGIFY(x)
184
#define __SCN64(x) __STRINGIFY(x)
209
#define __SCN64FAST(x) __FAST64 __STRINGIFY(x)
185
#endif
210
 
186
 
211
#if __int64_t_defined
Line 194... Line 219...
194
#define SCNd64		__SCN64(d)
219
#define SCNd64		__SCN64(d)
195
#define SCNi64		__SCN64(i)
220
#define SCNi64		__SCN64(i)
196
#define SCNo64		__SCN64(o)
221
#define SCNo64		__SCN64(o)
197
#define SCNu64		__SCN64(u)
222
#define SCNu64		__SCN64(u)
198
#define SCNx64		__SCN64(x)
223
#define SCNx64		__SCN64(x)
-
 
224
#endif
Line 199... Line 225...
199
 
225
 
200
#if __int64_t_defined
226
#if __int_least64_t_defined
201
#define PRIdLEAST64	__PRI64(d)
227
#define PRIdLEAST64	__PRI64LEAST(d)
202
#define PRIiLEAST64	__PRI64(i)
228
#define PRIiLEAST64	__PRI64LEAST(i)
203
#define PRIoLEAST64	__PRI64(o)
229
#define PRIoLEAST64	__PRI64LEAST(o)
204
#define PRIuLEAST64	__PRI64(u)
230
#define PRIuLEAST64	__PRI64LEAST(u)
205
#define PRIxLEAST64	__PRI64(x)
231
#define PRIxLEAST64	__PRI64LEAST(x)
206
#define PRIXLEAST64	__PRI64(X)
232
#define PRIXLEAST64	__PRI64LEAST(X)
207
 
233
 
208
#define SCNdLEAST64	__SCN64(d)
234
#define SCNdLEAST64	__SCN64LEAST(d)
209
#define SCNiLEAST64	__SCN64(i)
235
#define SCNiLEAST64	__SCN64LEAST(i)
210
#define SCNoLEAST64	__SCN64(o)
236
#define SCNoLEAST64	__SCN64LEAST(o)
211
#define SCNuLEAST64	__SCN64(u)
237
#define SCNuLEAST64	__SCN64LEAST(u)
212
#define SCNxLEAST64	__SCN64(x)
238
#define SCNxLEAST64	__SCN64LEAST(x)
213
 
239
#endif
-
 
240
 
214
 
241
#if __int_fast64_t_defined
215
#define PRIdFAST64	__PRI64(d)
242
#define PRIdFAST64	__PRI64FAST(d)
216
#define PRIiFAST64	__PRI64(i)
243
#define PRIiFAST64	__PRI64FAST(i)
217
#define PRIoFAST64	__PRI64(o)
244
#define PRIoFAST64	__PRI64FAST(o)
218
#define PRIuFAST64	__PRI64(u)
245
#define PRIuFAST64	__PRI64FAST(u)
219
#define PRIxFAST64	__PRI64(x)
246
#define PRIxFAST64	__PRI64FAST(x)
220
#define PRIXFAST64	__PRI64(X)
247
#define PRIXFAST64	__PRI64FAST(X)
221
 
248
 
222
#define SCNdFAST64	__SCN64(d)
249
#define SCNdFAST64	__SCN64FAST(d)
223
#define SCNiFAST64	__SCN64(i)
250
#define SCNiFAST64	__SCN64FAST(i)
224
#define SCNoFAST64	__SCN64(o)
251
#define SCNoFAST64	__SCN64FAST(o)
225
#define SCNuFAST64	__SCN64(u)
252
#define SCNuFAST64	__SCN64FAST(u)
226
#define SCNxFAST64	__SCN64(x)
253
#define SCNxFAST64	__SCN64FAST(x)
Line 227... Line 254...
227
#endif
254
#endif
228
 
255
 
229
/* max-bit types */
256
/* max-bit types */
Line 250... Line 277...
250
#define SCNoMAX		__SCNMAX(o)
277
#define SCNoMAX		__SCNMAX(o)
251
#define SCNuMAX		__SCNMAX(u)
278
#define SCNuMAX		__SCNMAX(u)
252
#define SCNxMAX		__SCNMAX(x)
279
#define SCNxMAX		__SCNMAX(x)
Line 253... Line 280...
253
 
280
 
254
/* ptr types */
281
/* ptr types */
255
#if PTRDIFF_MAX <= __INTTYPES_EXP(INT_MAX)
282
#if defined (_INTPTR_EQ_LONGLONG)
256
# define __PRIPTR(x) __STRINGIFY(x)
283
# define __PRIPTR(x) __STRINGIFY(ll##x)
257
# define __SCNPTR(x) __STRINGIFY(x)
284
# define __SCNPTR(x) __STRINGIFY(ll##x)
258
#elif PTRDIFF_MAX <= __INTTYPES_EXP(LONG_MAX) || !defined(__have_longlong64)
285
#elif defined (_INTPTR_EQ_LONG)
259
# define __PRIPTR(x) __STRINGIFY(l##x)
286
# define __PRIPTR(x) __STRINGIFY(l##x)
260
# define __SCNPTR(x) __STRINGIFY(l##x)
287
# define __SCNPTR(x) __STRINGIFY(l##x)
261
#else
288
#else
262
# define __PRIPTR(x) __STRINGIFY(ll##x)
289
# define __PRIPTR(x) __STRINGIFY(x)
263
# define __SCNPTR(x) __STRINGIFY(ll##x)
290
# define __SCNPTR(x) __STRINGIFY(x)
Line 264... Line 291...
264
#endif
291
#endif
265
 
292
 
266
#define PRIdPTR		__PRIPTR(d)
293
#define PRIdPTR		__PRIPTR(d)