3 * Copyright (c) 2005 Paul Hsieh
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * Redistributions in binary form must not misrepresent the orignal
13 * source in the documentation and/or other materials provided
14 * with the distribution.
16 * The names of the authors not its contributors may be used to
17 * endorse or promote products derived from this software without
18 * specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 * OF THE POSSIBILITY OF SUCH DAMAGE.
33 ****************************************************************************
37 * The ANSI C standard committee, for the C99 standard, specified the
38 * inclusion of a new standard include file called stdint.h. This is
39 * a very useful and long desired include file which contains several
40 * very precise definitions for integer scalar types that is
41 * critically important for making portable several classes of
42 * applications including cryptography, hashing, variable length
43 * integer libraries and so on. But for most developers its likely
44 * useful just for programming sanity.
46 * The problem is that most compiler vendors have decided not to
47 * implement the C99 standard, and the next C++ language standard
48 * (which has a lot more mindshare these days) will be a long time in
49 * coming and its unknown whether or not it will include stdint.h or
50 * how much adoption it will have. Either way, it will be a long time
51 * before all compilers come with a stdint.h and it also does nothing
52 * for the extremely large number of compilers available today which
53 * do not include this file, or anything comparable to it.
55 * So that's what this file is all about. Its an attempt to build a
56 * single universal include file that works on as many platforms as
57 * possible to deliver what stdint.h is supposed to. A few things
58 * that should be noted about this file:
60 * 1) It is not guaranteed to be portable and/or present an identical
61 * interface on all platforms. The extreme variability of the
62 * ANSI C standard makes this an impossibility right from the
63 * very get go. Its really only meant to be useful for the vast
64 * majority of platforms that possess the capability of
65 * implementing usefully and precisely defined, standard sized
66 * integer scalars. Systems which are not intrinsically 2s
67 * complement may produce invalid constants.
69 * 2) There is an unavoidable use of non-reserved symbols.
71 * 3) Other standard include files are invoked.
73 * 4) This file may come in conflict with future platforms that do
74 * include stdint.h. The hope is that one or the other can be
75 * used with no real difference.
77 * 5) In the current verison, if your platform can't represent
78 * int32_t, int16_t and int8_t, it just dumps out with a compiler
81 * 6) 64 bit integers may or may not be defined. Test for their
82 * presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
83 * Note that this is different from the C99 specification which
84 * requires the existence of 64 bit support in the compiler. If
85 * this is not defined for your platform, yet it is capable of
86 * dealing with 64 bits then it is because this file has not yet
87 * been extended to cover all of your system's capabilities.
89 * 7) (u)intptr_t may or may not be defined. Test for its presence
90 * with the test: #ifdef PTRDIFF_MAX. If this is not defined
91 * for your platform, then it is because this file has not yet
92 * been extended to cover all of your system's capabilities, not
93 * because its optional.
95 * 8) The following might not been defined even if your platform is
96 * capable of defining it:
105 * 9) The following have not been defined:
110 * 10) The criteria for defining (u)int_least(*)_t isn't clear,
111 * except for systems which don't have a type that precisely
112 * defined 8, 16, or 32 bit types (which this include file does
113 * not support anyways). Default definitions have been given.
115 * 11) The criteria for defining (u)int_fast(*)_t isn't something I
116 * would trust to any particular compiler vendor or the ANSI C
117 * comittee. It is well known that "compatible systems" are
118 * commonly created that have very different performance
119 * characteristics from the systems they are compatible with,
120 * especially those whose vendors make both the compiler and the
121 * system. Default definitions have been given, but its strongly
122 * recommended that users never use these definitions for any
123 * reason (they do *NOT* deliver any serious guarantee of
124 * improved performance -- not in this file, nor any vendor's
127 * 12) The following macros:
129 * PRINTF_INTMAX_MODIFIER
130 * PRINTF_INT64_MODIFIER
131 * PRINTF_INT32_MODIFIER
132 * PRINTF_INT16_MODIFIER
133 * PRINTF_LEAST64_MODIFIER
134 * PRINTF_LEAST32_MODIFIER
135 * PRINTF_LEAST16_MODIFIER
136 * PRINTF_INTPTR_MODIFIER
138 * are strings which have been defined as the modifiers required
139 * for the "d", "u" and "x" printf formats to correctly output
140 * (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
141 * (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
142 * PRINTF_INTPTR_MODIFIER is not defined for some systems which
143 * provide their own stdint.h. PRINTF_INT64_MODIFIER is not
144 * defined if INT64_MAX is not defined. These are an extension
145 * beyond what C99 specifies must be in stdint.h.
147 * In addition, the following macros are defined:
149 * PRINTF_INTMAX_HEX_WIDTH
150 * PRINTF_INT64_HEX_WIDTH
151 * PRINTF_INT32_HEX_WIDTH
152 * PRINTF_INT16_HEX_WIDTH
153 * PRINTF_INT8_HEX_WIDTH
154 * PRINTF_INTMAX_DEC_WIDTH
155 * PRINTF_INT64_DEC_WIDTH
156 * PRINTF_INT32_DEC_WIDTH
157 * PRINTF_INT16_DEC_WIDTH
158 * PRINTF_INT8_DEC_WIDTH
160 * Which specifies the maximum number of characters required to
161 * print the number of that type in either hexadecimal or decimal.
162 * These are an extension beyond what C99 specifies must be in
165 * Compilers tested (all with 0 warnings at their highest respective
166 * settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
167 * bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
168 * .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
170 * This file should be considered a work in progress. Suggestions for
171 * improvements, especially those which increase coverage are strongly
181 # define SIZE_MAX (~(size_t)0)
185 * For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
189 #if defined(__GNUC__) && defined(_STDINT_H) && !defined (_STDINT_H_INCLUDED)
190 #define _STDINT_H_INCLUDED
191 # ifndef PRINTF_INT64_MODIFIER
192 # define PRINTF_INT64_MODIFIER "ll"
194 # ifndef PRINTF_INT32_MODIFIER
195 # define PRINTF_INT32_MODIFIER "l"
197 # ifndef PRINTF_INT16_MODIFIER
198 # define PRINTF_INT16_MODIFIER "h"
200 # ifndef PRINTF_INTMAX_MODIFIER
201 # define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
203 # ifndef PRINTF_INT64_HEX_WIDTH
204 # define PRINTF_INT64_HEX_WIDTH "16"
206 # ifndef PRINTF_INT32_HEX_WIDTH
207 # define PRINTF_INT32_HEX_WIDTH "8"
209 # ifndef PRINTF_INT16_HEX_WIDTH
210 # define PRINTF_INT16_HEX_WIDTH "4"
212 # ifndef PRINTF_INT8_HEX_WIDTH
213 # define PRINTF_INT8_HEX_WIDTH "2"
215 # ifndef PRINTF_INT64_DEC_WIDTH
216 # define PRINTF_INT64_DEC_WIDTH "20"
218 # ifndef PRINTF_INT32_DEC_WIDTH
219 # define PRINTF_INT32_DEC_WIDTH "10"
221 # ifndef PRINTF_INT16_DEC_WIDTH
222 # define PRINTF_INT16_DEC_WIDTH "5"
224 # ifndef PRINTF_INT8_DEC_WIDTH
225 # define PRINTF_INT8_DEC_WIDTH "3"
227 # ifndef PRINTF_INTMAX_HEX_WIDTH
228 # define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
230 # ifndef PRINTF_INTMAX_DEC_WIDTH
231 # define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
235 #ifndef _STDINT_H_INCLUDED
236 #define _STDINT_H_INCLUDED
239 * Deduce the type assignments from limits.h under the assumption that
240 * integer sizes in bits are powers of 2, and follow the ANSI
245 # define UINT8_MAX 0xff
248 # if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
249 typedef unsigned char uint8_t;
250 # define UINT8_C(v) ((uint8_t) v)
252 # error "Platform not supported"
257 # define INT8_MAX 0x7f
260 # define INT8_MIN INT8_C(0x80)
263 # if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
264 typedef signed char int8_t;
265 # define INT8_C(v) ((int8_t) v)
267 # error "Platform not supported"
272 # define UINT16_MAX 0xffff
275 #if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
276 typedef unsigned int uint16_t;
277 # ifndef PRINTF_INT16_MODIFIER
278 # define PRINTF_INT16_MODIFIER ""
280 # define UINT16_C(v) ((uint16_t) (v))
281 #elif (USHRT_MAX == UINT16_MAX)
282 typedef unsigned short uint16_t;
283 # define UINT16_C(v) ((uint16_t) (v))
284 # ifndef PRINTF_INT16_MODIFIER
285 # define PRINTF_INT16_MODIFIER "h"
288 #error "Platform not supported"
293 # define INT16_MAX 0x7fff
296 # define INT16_MIN INT16_C(0x8000)
299 #if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
300 typedef signed int int16_t;
301 # define INT16_C(v) ((int16_t) (v))
302 # ifndef PRINTF_INT16_MODIFIER
303 # define PRINTF_INT16_MODIFIER ""
305 #elif (SHRT_MAX == INT16_MAX)
306 typedef signed short int16_t;
307 # define INT16_C(v) ((int16_t) (v))
308 # ifndef PRINTF_INT16_MODIFIER
309 # define PRINTF_INT16_MODIFIER "h"
312 #error "Platform not supported"
317 # define UINT32_MAX (0xffffffffUL)
320 #if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
321 typedef unsigned long uint32_t;
322 # define UINT32_C(v) v ## UL
323 # ifndef PRINTF_INT32_MODIFIER
324 # define PRINTF_INT32_MODIFIER "l"
326 #elif (UINT_MAX == UINT32_MAX)
327 typedef unsigned int uint32_t;
328 # ifndef PRINTF_INT32_MODIFIER
329 # define PRINTF_INT32_MODIFIER ""
331 # define UINT32_C(v) v ## U
332 #elif (USHRT_MAX == UINT32_MAX)
333 typedef unsigned short uint32_t;
334 # define UINT32_C(v) ((unsigned short) (v))
335 # ifndef PRINTF_INT32_MODIFIER
336 # define PRINTF_INT32_MODIFIER ""
339 #error "Platform not supported"
344 # define INT32_MAX (0x7fffffffL)
347 # define INT32_MIN INT32_C(0x80000000)
350 #if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
351 typedef signed long int32_t;
352 # define INT32_C(v) v ## L
353 # ifndef PRINTF_INT32_MODIFIER
354 # define PRINTF_INT32_MODIFIER "l"
356 #elif (INT_MAX == INT32_MAX)
357 typedef signed int int32_t;
358 # define INT32_C(v) v
359 # ifndef PRINTF_INT32_MODIFIER
360 # define PRINTF_INT32_MODIFIER ""
362 #elif (SHRT_MAX == INT32_MAX)
363 typedef signed short int32_t;
364 # define INT32_C(v) ((short) (v))
365 # ifndef PRINTF_INT32_MODIFIER
366 # define PRINTF_INT32_MODIFIER ""
369 #error "Platform not supported"
374 * The macro stdint_int64_defined is temporarily used to record
375 * whether or not 64 integer support is available. It must be
376 * defined for any 64 integer extensions for new platforms that are
380 #undef stdint_int64_defined
381 #if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
382 # if (__STDC__ && __STDC_VERSION >= 199901L) || defined (S_SPLINT_S)
383 # define stdint_int64_defined
384 typedef long long int64_t;
385 typedef unsigned long long uint64_t;
386 # define UINT64_C(v) v ## ULL
387 # define INT64_C(v) v ## LL
388 # ifndef PRINTF_INT64_MODIFIER
389 # define PRINTF_INT64_MODIFIER "ll"
394 #if !defined (stdint_int64_defined)
395 # if defined(__GNUC__) || defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
396 # define stdint_int64_defined
397 typedef long long int64_t;
398 typedef unsigned long long uint64_t;
399 # define UINT64_C(v) v ## ULL
400 # define INT64_C(v) v ## LL
401 # ifndef PRINTF_INT64_MODIFIER
402 # define PRINTF_INT64_MODIFIER "ll"
404 # elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || defined (__BORLANDC__) || defined (__alpha) || defined (__DECC)
405 # define stdint_int64_defined
406 typedef __int64 int64_t;
407 typedef unsigned __int64 uint64_t;
408 # define UINT64_C(v) v ## UI64
409 # define INT64_C(v) v ## I64
410 # ifndef PRINTF_INT64_MODIFIER
411 # define PRINTF_INT64_MODIFIER "I64"
416 #if !defined (LONG_LONG_MAX) && defined (INT64_C)
417 # define LONG_LONG_MAX INT64_C (9223372036854775807)
419 #ifndef ULONG_LONG_MAX
420 # define ULONG_LONG_MAX UINT64_C (18446744073709551615)
423 #if !defined (INT64_MAX) && defined (INT64_C)
424 # define INT64_MAX INT64_C (9223372036854775807)
426 #if !defined (INT64_MIN) && defined (INT64_C)
427 # define INT64_MIN INT64_C (-9223372036854775808)
429 #if !defined (UINT64_MAX) && defined (INT64_C)
430 # define UINT64_MAX UINT64_C (18446744073709551615)
434 * Width of hexadecimal for number field.
437 #ifndef PRINTF_INT64_HEX_WIDTH
438 # define PRINTF_INT64_HEX_WIDTH "16"
440 #ifndef PRINTF_INT32_HEX_WIDTH
441 # define PRINTF_INT32_HEX_WIDTH "8"
443 #ifndef PRINTF_INT16_HEX_WIDTH
444 # define PRINTF_INT16_HEX_WIDTH "4"
446 #ifndef PRINTF_INT8_HEX_WIDTH
447 # define PRINTF_INT8_HEX_WIDTH "2"
450 #ifndef PRINTF_INT64_DEC_WIDTH
451 # define PRINTF_INT64_DEC_WIDTH "20"
453 #ifndef PRINTF_INT32_DEC_WIDTH
454 # define PRINTF_INT32_DEC_WIDTH "10"
456 #ifndef PRINTF_INT16_DEC_WIDTH
457 # define PRINTF_INT16_DEC_WIDTH "5"
459 #ifndef PRINTF_INT8_DEC_WIDTH
460 # define PRINTF_INT8_DEC_WIDTH "3"
464 * Ok, lets not worry about 128 bit integers for now. Moore's law says
465 * we don't need to worry about that until about 2040 at which point
466 * I'll have bigger things to worry about; like what W did to my social
470 #ifdef stdint_int64_defined
471 typedef int64_t intmax_t;
472 typedef uint64_t uintmax_t;
473 # define INTMAX_MAX INT64_MAX
474 # define INTMAX_MIN INT64_MIN
475 # define UINTMAX_MAX UINT64_MAX
476 # define UINTMAX_C(v) UINT64_C(v)
477 # define INTMAX_C(v) INT64_C(v)
478 # ifndef PRINTF_INTMAX_MODIFIER
479 # define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
481 # ifndef PRINTF_INTMAX_HEX_WIDTH
482 # define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
484 # ifndef PRINTF_INTMAX_DEC_WIDTH
485 # define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
488 typedef int32_t intmax_t;
489 typedef uint32_t uintmax_t;
490 # define INTMAX_MAX INT32_MAX
491 # define UINTMAX_MAX UINT32_MAX
492 # define UINTMAX_C(v) UINT32_C(v)
493 # define INTMAX_C(v) INT32_C(v)
494 # ifndef PRINTF_INTMAX_MODIFIER
495 # define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
497 # ifndef PRINTF_INTMAX_HEX_WIDTH
498 # define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
500 # ifndef PRINTF_INTMAX_DEC_WIDTH
501 # define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
506 * Because this file currently only supports platforms which have
507 * precise powers of 2 as bit sizes for the default integers, the
508 * least definitions are all trivial. Its possible that a future
509 * version of this file could have different definitions.
512 #ifndef stdint_least_defined
513 typedef int8_t int_least8_t;
514 typedef uint8_t uint_least8_t;
515 typedef int16_t int_least16_t;
516 typedef uint16_t uint_least16_t;
517 typedef int32_t int_least32_t;
518 typedef uint32_t uint_least32_t;
519 # define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
520 # define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
521 # define UINT_LEAST8_MAX UINT8_MAX
522 # define INT_LEAST8_MAX INT8_MAX
523 # define UINT_LEAST16_MAX UINT16_MAX
524 # define INT_LEAST16_MAX INT16_MAX
525 # define UINT_LEAST32_MAX UINT32_MAX
526 # define INT_LEAST32_MAX INT32_MAX
527 # define INT_LEAST8_MIN INT8_MIN
528 # define INT_LEAST16_MIN INT16_MIN
529 # define INT_LEAST32_MIN INT32_MIN
530 # ifdef stdint_int64_defined
531 typedef int64_t int_least64_t;
532 typedef uint64_t uint_least64_t;
533 # define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
534 # define UINT_LEAST64_MAX UINT64_MAX
535 # define INT_LEAST64_MAX INT64_MAX
536 # define INT_LEAST64_MIN INT64_MIN
539 #undef stdint_least_defined
542 * The ANSI C committee pretending to know or specify anything about
543 * performance is the epitome of misguided arrogance. The mandate of
544 * this file is to *ONLY* ever support that absolute minimum
545 * definition of the fast integer types, for compatibility purposes.
546 * No extensions, and no attempt to suggest what may or may not be a
547 * faster integer type will ever be made in this file. Developers are
548 * warned to stay away from these types when using this or any other
552 typedef int_least8_t int_fast8_t;
553 typedef uint_least8_t uint_fast8_t;
554 typedef int_least16_t int_fast16_t;
555 typedef uint_least16_t uint_fast16_t;
556 typedef int_least32_t int_fast32_t;
557 typedef uint_least32_t uint_fast32_t;
558 #define UINT_FAST8_MAX UINT_LEAST8_MAX
559 #define INT_FAST8_MAX INT_LEAST8_MAX
560 #define UINT_FAST16_MAX UINT_LEAST16_MAX
561 #define INT_FAST16_MAX INT_LEAST16_MAX
562 #define UINT_FAST32_MAX UINT_LEAST32_MAX
563 #define INT_FAST32_MAX INT_LEAST32_MAX
564 #define INT_FAST8_MIN IN_LEASTT8_MIN
565 #define INT_FAST16_MIN INT_LEAST16_MIN
566 #define INT_FAST32_MIN INT_LEAST32_MIN
567 #ifdef stdint_int64_defined
568 typedef int_least64_t int_fast64_t;
569 typedef uint_least64_t uint_fast64_t;
570 # define UINT_FAST64_MAX UINT_LEAST64_MAX
571 # define INT_FAST64_MAX INT_LEAST64_MAX
572 # define INT_FAST64_MIN INT_LEAST64_MIN
575 #undef stdint_int64_defined
578 * Whatever piecemeal, per compiler thing we can do about the wchar_t
582 #if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__)
588 # define WCHAR_MAX ((wchar_t)-1)
593 * Whatever piecemeal, per compiler/platform thing we can do about the
594 * (u)intptr_t types and limits.
597 #if defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)
598 # define STDINT_H_UINTPTR_T_DEFINED
601 #ifndef STDINT_H_UINTPTR_T_DEFINED
602 # if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64)
603 # define stdint_intptr_bits 64
604 # elif defined (__WATCOMC__) || defined (__TURBOC__)
605 # if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
606 # define stdint_intptr_bits 16
608 # define stdint_intptr_bits 32
610 # elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
611 # define stdint_intptr_bits 32
612 # elif defined (__INTEL_COMPILER)
613 /* TODO -- what will Intel do about x86-64? */
616 # ifdef stdint_intptr_bits
617 # define stdint_intptr_glue3_i(a,b,c) a##b##c
618 # define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
619 # ifndef PRINTF_INTPTR_MODIFIER
620 # define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
623 # define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
626 # define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
629 # define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
632 # define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
635 # define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
637 typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
638 typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
640 /* TODO -- This following is likely wrong for some platforms, and does
641 nothing for the definition of uintptr_t. */
642 typedef ptrdiff_t intptr_t;
644 # define STDINT_H_UINTPTR_T_DEFINED
648 * Assumes sig_atomic_t is signed and we have a 2s complement machine.
651 #ifndef SIG_ATOMIC_MAX
652 # define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)