[9ddcb0b] | 1 | /*
|
---|
| 2 | * Copyright (c) 2017 CZ.NIC, z.s.p.o.
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /* Authors:
|
---|
| 30 | * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | /** @addtogroup bits
|
---|
| 34 | * @{
|
---|
| 35 | */
|
---|
| 36 | /** @file
|
---|
| 37 | */
|
---|
| 38 |
|
---|
| 39 | #ifndef _BITS_STDINT_H_
|
---|
| 40 | #define _BITS_STDINT_H_
|
---|
| 41 |
|
---|
| 42 | #include <_bits/macros.h>
|
---|
| 43 |
|
---|
| 44 | typedef __INT8_TYPE__ int8_t;
|
---|
| 45 | typedef __INT8_TYPE__ int_least8_t;
|
---|
| 46 | typedef __INT8_TYPE__ int_fast8_t;
|
---|
| 47 |
|
---|
| 48 | typedef __UINT8_TYPE__ uint8_t;
|
---|
| 49 | typedef __UINT8_TYPE__ uint_least8_t;
|
---|
| 50 | typedef __UINT8_TYPE__ uint_fast8_t;
|
---|
| 51 |
|
---|
| 52 | typedef __INT16_TYPE__ int16_t;
|
---|
| 53 | typedef __INT16_TYPE__ int_least16_t;
|
---|
| 54 | typedef __INT16_TYPE__ int_fast16_t;
|
---|
| 55 |
|
---|
| 56 | typedef __UINT16_TYPE__ uint16_t;
|
---|
| 57 | typedef __UINT16_TYPE__ uint_least16_t;
|
---|
| 58 | typedef __UINT16_TYPE__ uint_fast16_t;
|
---|
| 59 |
|
---|
| 60 | typedef __INT32_TYPE__ int32_t;
|
---|
| 61 | typedef __INT32_TYPE__ int_least32_t;
|
---|
| 62 | typedef __INT32_TYPE__ int_fast32_t;
|
---|
| 63 |
|
---|
| 64 | typedef __UINT32_TYPE__ uint32_t;
|
---|
| 65 | typedef __UINT32_TYPE__ uint_least32_t;
|
---|
| 66 | typedef __UINT32_TYPE__ uint_fast32_t;
|
---|
| 67 |
|
---|
| 68 | typedef __INT64_TYPE__ int64_t;
|
---|
| 69 | typedef __INT64_TYPE__ int_least64_t;
|
---|
| 70 | typedef __INT64_TYPE__ int_fast64_t;
|
---|
| 71 |
|
---|
| 72 | typedef __UINT64_TYPE__ uint64_t;
|
---|
| 73 | typedef __UINT64_TYPE__ uint_least64_t;
|
---|
| 74 | typedef __UINT64_TYPE__ uint_fast64_t;
|
---|
| 75 |
|
---|
| 76 | #define INT8_MIN __INT8_MIN__
|
---|
| 77 | #define INT_LEAST8_MIN __INT8_MIN__
|
---|
| 78 | #define INT_FAST8_MIN __INT8_MIN__
|
---|
| 79 |
|
---|
| 80 | #define INT8_MAX __INT8_MAX__
|
---|
| 81 | #define INT_LEAST8_MAX __INT8_MAX__
|
---|
| 82 | #define INT_FAST8_MAX __INT8_MAX__
|
---|
| 83 |
|
---|
| 84 | #define UINT8_MIN __UINT8_C(0)
|
---|
| 85 | #define UINT_LEAST8_MIN __UINT8_C(0)
|
---|
| 86 | #define UINT_FAST8_MIN __UINT8_C(0)
|
---|
| 87 |
|
---|
| 88 | #define UINT8_MAX __UINT8_MAX__
|
---|
| 89 | #define UINT_LEAST8_MAX __UINT8_MAX__
|
---|
| 90 | #define UINT_FAST8_MAX __UINT8_MAX__
|
---|
| 91 |
|
---|
| 92 | #define INT16_MIN __INT16_MIN__
|
---|
| 93 | #define INT_LEAST16_MIN __INT16_MIN__
|
---|
| 94 | #define INT_FAST16_MIN __INT16_MIN__
|
---|
| 95 |
|
---|
| 96 | #define INT16_MAX __INT16_MAX__
|
---|
| 97 | #define INT_LEAST16_MAX __INT16_MAX__
|
---|
| 98 | #define INT_FAST16_MAX __INT16_MAX__
|
---|
| 99 |
|
---|
| 100 | #define UINT16_MIN __UINT16_C(0)
|
---|
| 101 | #define UINT_LEAST16_MIN __UINT16_C(0)
|
---|
| 102 | #define UINT_FAST16_MIN __UINT16_C(0)
|
---|
| 103 |
|
---|
| 104 | #define UINT16_MAX __UINT16_MAX__
|
---|
| 105 | #define UINT_LEAST16_MAX __UINT16_MAX__
|
---|
| 106 | #define UINT_FAST16_MAX __UINT16_MAX__
|
---|
| 107 |
|
---|
| 108 | #define INT32_MIN __INT32_MIN__
|
---|
| 109 | #define INT_LEAST32_MIN __INT32_MIN__
|
---|
| 110 | #define INT_FAST32_MIN __INT32_MIN__
|
---|
| 111 |
|
---|
| 112 | #define INT32_MAX __INT32_MAX__
|
---|
| 113 | #define INT_LEAST32_MAX __INT32_MAX__
|
---|
| 114 | #define INT_FAST32_MAX __INT32_MAX__
|
---|
| 115 |
|
---|
| 116 | #define UINT32_MIN __UINT32_C(0)
|
---|
| 117 | #define UINT_LEAST32_MIN __UINT32_C(0)
|
---|
| 118 | #define UINT_FAST32_MIN __UINT32_C(0)
|
---|
| 119 |
|
---|
| 120 | #define UINT32_MAX __UINT32_MAX__
|
---|
| 121 | #define UINT_LEAST32_MAX __UINT32_MAX__
|
---|
| 122 | #define UINT_FAST32_MAX __UINT32_MAX__
|
---|
| 123 |
|
---|
| 124 | #define INT64_MIN __INT64_MIN__
|
---|
| 125 | #define INT_LEAST64_MIN __INT64_MIN__
|
---|
| 126 | #define INT_FAST64_MIN __INT64_MIN__
|
---|
| 127 |
|
---|
| 128 | #define INT64_MAX __INT64_MAX__
|
---|
| 129 | #define INT_LEAST64_MAX __INT64_MAX__
|
---|
| 130 | #define INT_FAST64_MAX __INT64_MAX__
|
---|
| 131 |
|
---|
| 132 | #define UINT64_MIN __UINT64_C(0)
|
---|
| 133 | #define UINT_LEAST64_MIN __UINT64_C(0)
|
---|
| 134 | #define UINT_FAST64_MIN __UINT64_C(0)
|
---|
| 135 |
|
---|
| 136 | #define UINT64_MAX __UINT64_MAX__
|
---|
| 137 | #define UINT_LEAST64_MAX __UINT64_MAX__
|
---|
| 138 | #define UINT_FAST64_MAX __UINT64_MAX__
|
---|
| 139 |
|
---|
| 140 | #define INT8_C(x) __INT8_C(x)
|
---|
| 141 | #define INT16_C(x) __INT16_C(x)
|
---|
| 142 | #define INT32_C(x) __INT32_C(x)
|
---|
| 143 | #define INT64_C(x) __INT64_C(x)
|
---|
| 144 | #define UINT8_C(x) __UINT8_C(x)
|
---|
| 145 | #define UINT16_C(x) __UINT16_C(x)
|
---|
| 146 | #define UINT32_C(x) __UINT32_C(x)
|
---|
| 147 | #define UINT64_C(x) __UINT64_C(x)
|
---|
| 148 |
|
---|
| 149 | typedef __INTPTR_TYPE__ intptr_t;
|
---|
| 150 | typedef __UINTPTR_TYPE__ uintptr_t;
|
---|
| 151 |
|
---|
| 152 | #define INTPTR_MIN __INTPTR_MIN__
|
---|
| 153 | #define INTPTR_MAX __INTPTR_MAX__
|
---|
| 154 | #define UINTPTR_MIN __UINTPTR_C(0)
|
---|
| 155 | #define UINTPTR_MAX __UINTPTR_MAX__
|
---|
| 156 |
|
---|
| 157 | typedef __INTMAX_TYPE__ intmax_t;
|
---|
| 158 | typedef __UINTMAX_TYPE__ uintmax_t;
|
---|
| 159 |
|
---|
| 160 | #define INTMAX_MIN __INTMAX_MIN__
|
---|
| 161 | #define INTMAX_MAX __INTMAX_MAX__
|
---|
| 162 | #define UINTMAX_MIN __UINTMAX_C(0)
|
---|
| 163 | #define UINTMAX_MAX __UINTMAX_MAX__
|
---|
| 164 |
|
---|
| 165 | #define INTMAX_C(x) __INTMAX_C(x)
|
---|
| 166 | #define UINTMAX_C(x) __UINTMAX_C(x)
|
---|
| 167 |
|
---|
| 168 | #define PTRDIFF_MIN __PTRDIFF_MIN__
|
---|
| 169 | #define PTRDIFF_MAX __PTRDIFF_MAX__
|
---|
| 170 |
|
---|
| 171 | #define SIZE_MIN 0
|
---|
| 172 | #define SIZE_MAX __SIZE_MAX__
|
---|
| 173 |
|
---|
| 174 | #define WCHAR_MIN __WCHAR_MIN__
|
---|
| 175 | #define WCHAR_MAX __WCHAR_MAX__
|
---|
| 176 |
|
---|
| 177 | #define WINT_MIN __WINT_MIN__
|
---|
| 178 | #define WINT_MAX __WINT_MAX__
|
---|
| 179 |
|
---|
| 180 | /* Use nonstandard 128-bit types if they are supported by the compiler. */
|
---|
| 181 |
|
---|
| 182 | #ifdef __SIZEOF_INT128__
|
---|
| 183 | typedef __int128 int128_t;
|
---|
| 184 | typedef unsigned __int128 uint128_t;
|
---|
| 185 | #endif
|
---|
| 186 |
|
---|
| 187 | #endif
|
---|
| 188 |
|
---|
| 189 | /** @}
|
---|
| 190 | */
|
---|