Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _STDINT_H |
| 2 | #define _STDINT_H |
| 3 | |
| 4 | #define __NEED_int8_t |
| 5 | #define __NEED_int16_t |
| 6 | #define __NEED_int32_t |
| 7 | #define __NEED_int64_t |
| 8 | |
| 9 | #define __NEED_uint8_t |
| 10 | #define __NEED_uint16_t |
| 11 | #define __NEED_uint32_t |
| 12 | #define __NEED_uint64_t |
| 13 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 14 | #define __NEED_intptr_t |
| 15 | #define __NEED_uintptr_t |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 16 | |
Rich Felker | f77bab5 | 2013-04-04 20:09:50 -0400 | [diff] [blame] | 17 | #define __NEED_intmax_t |
| 18 | #define __NEED_uintmax_t |
| 19 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 20 | #include <bits/alltypes.h> |
| 21 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 22 | typedef int8_t int_fast8_t; |
| 23 | typedef int64_t int_fast64_t; |
| 24 | |
Rich Felker | 28bde3b | 2011-04-11 10:38:00 -0400 | [diff] [blame] | 25 | typedef int8_t int_least8_t; |
| 26 | typedef int16_t int_least16_t; |
| 27 | typedef int32_t int_least32_t; |
| 28 | typedef int64_t int_least64_t; |
| 29 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 30 | typedef uint8_t uint_fast8_t; |
| 31 | typedef uint64_t uint_fast64_t; |
| 32 | |
Rich Felker | 28bde3b | 2011-04-11 10:38:00 -0400 | [diff] [blame] | 33 | typedef uint8_t uint_least8_t; |
| 34 | typedef uint16_t uint_least16_t; |
| 35 | typedef uint32_t uint_least32_t; |
| 36 | typedef uint64_t uint_least64_t; |
| 37 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 38 | #define INT8_MIN (-1-0x7f) |
| 39 | #define INT16_MIN (-1-0x7fff) |
| 40 | #define INT32_MIN (-1-0x7fffffff) |
Rich Felker | f77bab5 | 2013-04-04 20:09:50 -0400 | [diff] [blame] | 41 | #define INT64_MIN (-1-0x7fffffffffffffff) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 42 | |
| 43 | #define INT8_MAX (0x7f) |
| 44 | #define INT16_MAX (0x7fff) |
| 45 | #define INT32_MAX (0x7fffffff) |
Rich Felker | f77bab5 | 2013-04-04 20:09:50 -0400 | [diff] [blame] | 46 | #define INT64_MAX (0x7fffffffffffffff) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 47 | |
| 48 | #define UINT8_MAX (0xff) |
| 49 | #define UINT16_MAX (0xffff) |
Rich Felker | dac4fc4 | 2014-12-21 02:30:29 -0500 | [diff] [blame] | 50 | #define UINT32_MAX (0xffffffffu) |
| 51 | #define UINT64_MAX (0xffffffffffffffffu) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 52 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 53 | #define INT_FAST8_MIN INT8_MIN |
| 54 | #define INT_FAST64_MIN INT64_MIN |
| 55 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 56 | #define INT_LEAST8_MIN INT8_MIN |
| 57 | #define INT_LEAST16_MIN INT16_MIN |
| 58 | #define INT_LEAST32_MIN INT32_MIN |
| 59 | #define INT_LEAST64_MIN INT64_MIN |
| 60 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 61 | #define INT_FAST8_MAX INT8_MAX |
| 62 | #define INT_FAST64_MAX INT64_MAX |
| 63 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 64 | #define INT_LEAST8_MAX INT8_MAX |
| 65 | #define INT_LEAST16_MAX INT16_MAX |
| 66 | #define INT_LEAST32_MAX INT32_MAX |
| 67 | #define INT_LEAST64_MAX INT64_MAX |
| 68 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 69 | #define UINT_FAST8_MAX UINT8_MAX |
| 70 | #define UINT_FAST64_MAX UINT64_MAX |
| 71 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 72 | #define UINT_LEAST8_MAX UINT8_MAX |
| 73 | #define UINT_LEAST16_MAX UINT16_MAX |
| 74 | #define UINT_LEAST32_MAX UINT32_MAX |
| 75 | #define UINT_LEAST64_MAX UINT64_MAX |
| 76 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 77 | #define INTMAX_MIN INT64_MIN |
| 78 | #define INTMAX_MAX INT64_MAX |
| 79 | #define UINTMAX_MAX UINT64_MAX |
| 80 | |
Rich Felker | aee9b15 | 2014-12-17 16:52:37 -0500 | [diff] [blame] | 81 | #define WINT_MIN 0U |
Rich Felker | c4dd0c9 | 2013-07-22 13:05:41 -0400 | [diff] [blame] | 82 | #define WINT_MAX UINT32_MAX |
Rich Felker | 224c7a3 | 2011-09-19 17:39:51 -0400 | [diff] [blame] | 83 | |
Rich Felker | c7af271 | 2013-04-04 19:57:23 -0400 | [diff] [blame] | 84 | #if L'\0'-1 > 0 |
| 85 | #define WCHAR_MAX (0xffffffffu+L'\0') |
| 86 | #define WCHAR_MIN (0+L'\0') |
| 87 | #else |
| 88 | #define WCHAR_MAX (0x7fffffff+L'\0') |
| 89 | #define WCHAR_MIN (-1-0x7fffffff+L'\0') |
| 90 | #endif |
| 91 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 92 | #define SIG_ATOMIC_MIN INT32_MIN |
| 93 | #define SIG_ATOMIC_MAX INT32_MAX |
| 94 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 95 | #include <bits/stdint.h> |
| 96 | |
Rich Felker | a591e03 | 2012-02-07 12:08:27 -0500 | [diff] [blame] | 97 | #define INT8_C(c) c |
| 98 | #define INT16_C(c) c |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 99 | #define INT32_C(c) c |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 100 | |
Rich Felker | 3d64946 | 2012-06-08 11:11:44 -0400 | [diff] [blame] | 101 | #define UINT8_C(c) c |
| 102 | #define UINT16_C(c) c |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 103 | #define UINT32_C(c) c ## U |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 104 | |
Rich Felker | f77bab5 | 2013-04-04 20:09:50 -0400 | [diff] [blame] | 105 | #if UINTPTR_MAX == UINT64_MAX |
| 106 | #define INT64_C(c) c ## L |
| 107 | #define UINT64_C(c) c ## UL |
| 108 | #define INTMAX_C(c) c ## L |
| 109 | #define UINTMAX_C(c) c ## UL |
| 110 | #else |
| 111 | #define INT64_C(c) c ## LL |
| 112 | #define UINT64_C(c) c ## ULL |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 113 | #define INTMAX_C(c) c ## LL |
| 114 | #define UINTMAX_C(c) c ## ULL |
Rich Felker | f77bab5 | 2013-04-04 20:09:50 -0400 | [diff] [blame] | 115 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 116 | |
| 117 | #endif |