stdint.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022:
023: #ifndef _STDINT_H
024: #define _STDINT_H 1
025:
026: #include <features.h>
027: #include <bits/wchar.h>
028: #include <bits/wordsize.h>
029:
030:
031:
032:
033:
034:
035: #ifndef __int8_t_defined
036: # define __int8_t_defined
037: typedef signed char int8_t;
038: typedef short int int16_t;
039: typedef int int32_t;
040: # if __WORDSIZE == 64
041: typedef long int int64_t;
042: # else
043: __extension__
044: typedef long long int int64_t;
045: # endif
046: #endif
047:
048:
049: typedef unsigned char uint8_t;
050: typedef unsigned short int uint16_t;
051: #ifndef __uint32_t_defined
052: typedef unsigned int uint32_t;
053: # define __uint32_t_defined
054: #endif
055: #if __WORDSIZE == 64
056: typedef unsigned long int uint64_t;
057: #else
058: __extension__
059: typedef unsigned long long int uint64_t;
060: #endif
061:
062:
063:
064:
065:
066: typedef signed char int_least8_t;
067: typedef short int int_least16_t;
068: typedef int int_least32_t;
069: #if __WORDSIZE == 64
070: typedef long int int_least64_t;
071: #else
072: __extension__
073: typedef long long int int_least64_t;
074: #endif
075:
076:
077: typedef unsigned char uint_least8_t;
078: typedef unsigned short int uint_least16_t;
079: typedef unsigned int uint_least32_t;
080: #if __WORDSIZE == 64
081: typedef unsigned long int uint_least64_t;
082: #else
083: __extension__
084: typedef unsigned long long int uint_least64_t;
085: #endif
086:
087:
088:
089:
090:
091: typedef signed char int_fast8_t;
092: #if __WORDSIZE == 64
093: typedef long int int_fast16_t;
094: typedef long int int_fast32_t;
095: typedef long int int_fast64_t;
096: #else
097: typedef int int_fast16_t;
098: typedef int int_fast32_t;
099: __extension__
100: typedef long long int int_fast64_t;
101: #endif
102:
103:
104: typedef unsigned char uint_fast8_t;
105: #if __WORDSIZE == 64
106: typedef unsigned long int uint_fast16_t;
107: typedef unsigned long int uint_fast32_t;
108: typedef unsigned long int uint_fast64_t;
109: #else
110: typedef unsigned int uint_fast16_t;
111: typedef unsigned int uint_fast32_t;
112: __extension__
113: typedef unsigned long long int uint_fast64_t;
114: #endif
115:
116:
117:
118: #if __WORDSIZE == 64
119: # ifndef __intptr_t_defined
120: typedef long int intptr_t;
121: # define __intptr_t_defined
122: # endif
123: typedef unsigned long int uintptr_t;
124: #else
125: # ifndef __intptr_t_defined
126: typedef int intptr_t;
127: # define __intptr_t_defined
128: # endif
129: typedef unsigned int uintptr_t;
130: #endif
131:
132:
133:
134: #if __WORDSIZE == 64
135: typedef long int intmax_t;
136: typedef unsigned long int uintmax_t;
137: #else
138: __extension__
139: typedef long long int intmax_t;
140: __extension__
141: typedef unsigned long long int uintmax_t;
142: #endif
143:
144:
145:
146:
147: #if !defined __cplusplus || defined __STDC_LIMIT_MACROS
148:
149: # if __WORDSIZE == 64
150: # define __INT64_C(c) c ## L
151: # define __UINT64_C(c) c ## UL
152: # else
153: # define __INT64_C(c) c ## LL
154: # define __UINT64_C(c) c ## ULL
155: # endif
156:
157:
158:
159:
160: # define INT8_MIN (-128)
161: # define INT16_MIN (-32767-1)
162: # define INT32_MIN (-2147483647-1)
163: # define INT64_MIN (-__INT64_C(9223372036854775807)-1)
164:
165: # define INT8_MAX (127)
166: # define INT16_MAX (32767)
167: # define INT32_MAX (2147483647)
168: # define INT64_MAX (__INT64_C(9223372036854775807))
169:
170:
171: # define UINT8_MAX (255)
172: # define UINT16_MAX (65535)
173: # define UINT32_MAX (4294967295U)
174: # define UINT64_MAX (__UINT64_C(18446744073709551615))
175:
176:
177:
178: # define INT_LEAST8_MIN (-128)
179: # define INT_LEAST16_MIN (-32767-1)
180: # define INT_LEAST32_MIN (-2147483647-1)
181: # define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
182:
183: # define INT_LEAST8_MAX (127)
184: # define INT_LEAST16_MAX (32767)
185: # define INT_LEAST32_MAX (2147483647)
186: # define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
187:
188:
189: # define UINT_LEAST8_MAX (255)
190: # define UINT_LEAST16_MAX (65535)
191: # define UINT_LEAST32_MAX (4294967295U)
192: # define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
193:
194:
195:
196: # define INT_FAST8_MIN (-128)
197: # if __WORDSIZE == 64
198: # define INT_FAST16_MIN (-9223372036854775807L-1)
199: # define INT_FAST32_MIN (-9223372036854775807L-1)
200: # else
201: # define INT_FAST16_MIN (-2147483647-1)
202: # define INT_FAST32_MIN (-2147483647-1)
203: # endif
204: # define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
205:
206: # define INT_FAST8_MAX (127)
207: # if __WORDSIZE == 64
208: # define INT_FAST16_MAX (9223372036854775807L)
209: # define INT_FAST32_MAX (9223372036854775807L)
210: # else
211: # define INT_FAST16_MAX (2147483647)
212: # define INT_FAST32_MAX (2147483647)
213: # endif
214: # define INT_FAST64_MAX (__INT64_C(9223372036854775807))
215:
216:
217: # define UINT_FAST8_MAX (255)
218: # if __WORDSIZE == 64
219: # define UINT_FAST16_MAX (18446744073709551615UL)
220: # define UINT_FAST32_MAX (18446744073709551615UL)
221: # else
222: # define UINT_FAST16_MAX (4294967295U)
223: # define UINT_FAST32_MAX (4294967295U)
224: # endif
225: # define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
226:
227:
228:
229: # if __WORDSIZE == 64
230: # define INTPTR_MIN (-9223372036854775807L-1)
231: # define INTPTR_MAX (9223372036854775807L)
232: # define UINTPTR_MAX (18446744073709551615UL)
233: # else
234: # define INTPTR_MIN (-2147483647-1)
235: # define INTPTR_MAX (2147483647)
236: # define UINTPTR_MAX (4294967295U)
237: # endif
238:
239:
240:
241: # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
242:
243: # define INTMAX_MAX (__INT64_C(9223372036854775807))
244:
245:
246: # define UINTMAX_MAX (__UINT64_C(18446744073709551615))
247:
248:
249:
250:
251:
252: # if __WORDSIZE == 64
253: # define PTRDIFF_MIN (-9223372036854775807L-1)
254: # define PTRDIFF_MAX (9223372036854775807L)
255: # else
256: # define PTRDIFF_MIN (-2147483647-1)
257: # define PTRDIFF_MAX (2147483647)
258: # endif
259:
260:
261: # define SIG_ATOMIC_MIN (-2147483647-1)
262: # define SIG_ATOMIC_MAX (2147483647)
263:
264:
265: # if __WORDSIZE == 64
266: # define SIZE_MAX (18446744073709551615UL)
267: # else
268: # define SIZE_MAX (4294967295U)
269: # endif
270:
271:
272: # ifndef WCHAR_MIN
273:
274: # define WCHAR_MIN __WCHAR_MIN
275: # define WCHAR_MAX __WCHAR_MAX
276: # endif
277:
278:
279: # define WINT_MIN (0u)
280: # define WINT_MAX (4294967295u)
281:
282: #endif
283:
284:
285:
286:
287: #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
288:
289:
290: # define INT8_C(c) c
291: # define INT16_C(c) c
292: # define INT32_C(c) c
293: # if __WORDSIZE == 64
294: # define INT64_C(c) c ## L
295: # else
296: # define INT64_C(c) c ## LL
297: # endif
298:
299:
300: # define UINT8_C(c) c
301: # define UINT16_C(c) c
302: # define UINT32_C(c) c ## U
303: # if __WORDSIZE == 64
304: # define UINT64_C(c) c ## UL
305: # else
306: # define UINT64_C(c) c ## ULL
307: # endif
308:
309:
310: # if __WORDSIZE == 64
311: # define INTMAX_C(c) c ## L
312: # define UINTMAX_C(c) c ## UL
313: # else
314: # define INTMAX_C(c) c ## LL
315: # define UINTMAX_C(c) c ## ULL
316: # endif
317:
318: #endif
319:
320: #endif
321:
for client
18.221.165.246
© Andrew Scott 2006 -
2024,
All Rights Reserved