modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/stdint.h (about) 1 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* 19 * ISO C99: 7.18 Integer types <stdint.h> 20 */ 21 22 #ifndef _STDINT_H 23 #define _STDINT_H 1 24 25 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION 26 #include <bits/libc-header-start.h> 27 #include <bits/types.h> 28 #include <bits/wchar.h> 29 #include <bits/wordsize.h> 30 31 /* Exact integral types. */ 32 33 /* Signed. */ 34 #include <bits/stdint-intn.h> 35 36 /* Unsigned. */ 37 #include <bits/stdint-uintn.h> 38 39 /* Small types. */ 40 41 /* Signed. */ 42 typedef signed char int_least8_t; 43 typedef short int int_least16_t; 44 typedef int int_least32_t; 45 #if __WORDSIZE == 64 46 typedef long int int_least64_t; 47 #else 48 __extension__ typedef long long int int_least64_t; 49 #endif 50 51 /* Unsigned. */ 52 typedef unsigned char uint_least8_t; 53 typedef unsigned short int uint_least16_t; 54 typedef unsigned int uint_least32_t; 55 #if __WORDSIZE == 64 56 typedef unsigned long int uint_least64_t; 57 #else 58 __extension__ typedef unsigned long long int uint_least64_t; 59 #endif 60 61 /* Fast types. */ 62 63 /* Signed. */ 64 typedef signed char int_fast8_t; 65 #if __WORDSIZE == 64 66 typedef long int int_fast16_t; 67 typedef long int int_fast32_t; 68 typedef long int int_fast64_t; 69 #else 70 typedef int int_fast16_t; 71 typedef int int_fast32_t; 72 __extension__ typedef long long int int_fast64_t; 73 #endif 74 75 /* Unsigned. */ 76 typedef unsigned char uint_fast8_t; 77 #if __WORDSIZE == 64 78 typedef unsigned long int uint_fast16_t; 79 typedef unsigned long int uint_fast32_t; 80 typedef unsigned long int uint_fast64_t; 81 #else 82 typedef unsigned int uint_fast16_t; 83 typedef unsigned int uint_fast32_t; 84 __extension__ typedef unsigned long long int uint_fast64_t; 85 #endif 86 87 /* Types for `void *' pointers. */ 88 #if __WORDSIZE == 64 89 # ifndef __intptr_t_defined 90 typedef long int intptr_t; 91 # define __intptr_t_defined 92 # endif 93 typedef unsigned long int uintptr_t; 94 #else 95 # ifndef __intptr_t_defined 96 typedef int intptr_t; 97 # define __intptr_t_defined 98 # endif 99 typedef unsigned int uintptr_t; 100 #endif 101 102 /* Largest integral types. */ 103 typedef __intmax_t intmax_t; 104 typedef __uintmax_t uintmax_t; 105 106 # if __WORDSIZE == 64 107 # define __INT64_C(c) c ## L 108 # define __UINT64_C(c) c ## UL 109 # else 110 # define __INT64_C(c) c ## LL 111 # define __UINT64_C(c) c ## ULL 112 # endif 113 114 /* Limits of integral types. */ 115 116 /* Minimum of signed integral types. */ 117 # define INT8_MIN (-128) 118 # define INT16_MIN (-32767-1) 119 # define INT32_MIN (-2147483647-1) 120 # define INT64_MIN (-__INT64_C(9223372036854775807)-1) 121 /* Maximum of signed integral types. */ 122 # define INT8_MAX (127) 123 # define INT16_MAX (32767) 124 # define INT32_MAX (2147483647) 125 # define INT64_MAX (__INT64_C(9223372036854775807)) 126 127 /* Maximum of unsigned integral types. */ 128 # define UINT8_MAX (255) 129 # define UINT16_MAX (65535) 130 # define UINT32_MAX (4294967295U) 131 # define UINT64_MAX (__UINT64_C(18446744073709551615)) 132 133 /* Minimum of signed integral types having a minimum size. */ 134 # define INT_LEAST8_MIN (-128) 135 # define INT_LEAST16_MIN (-32767-1) 136 # define INT_LEAST32_MIN (-2147483647-1) 137 # define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) 138 /* Maximum of signed integral types having a minimum size. */ 139 # define INT_LEAST8_MAX (127) 140 # define INT_LEAST16_MAX (32767) 141 # define INT_LEAST32_MAX (2147483647) 142 # define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) 143 144 /* Maximum of unsigned integral types having a minimum size. */ 145 # define UINT_LEAST8_MAX (255) 146 # define UINT_LEAST16_MAX (65535) 147 # define UINT_LEAST32_MAX (4294967295U) 148 # define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) 149 150 /* Minimum of fast signed integral types having a minimum size. */ 151 # define INT_FAST8_MIN (-128) 152 # if __WORDSIZE == 64 153 # define INT_FAST16_MIN (-9223372036854775807L-1) 154 # define INT_FAST32_MIN (-9223372036854775807L-1) 155 # else 156 # define INT_FAST16_MIN (-2147483647-1) 157 # define INT_FAST32_MIN (-2147483647-1) 158 # endif 159 # define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) 160 /* Maximum of fast signed integral types having a minimum size. */ 161 # define INT_FAST8_MAX (127) 162 # if __WORDSIZE == 64 163 # define INT_FAST16_MAX (9223372036854775807L) 164 # define INT_FAST32_MAX (9223372036854775807L) 165 # else 166 # define INT_FAST16_MAX (2147483647) 167 # define INT_FAST32_MAX (2147483647) 168 # endif 169 # define INT_FAST64_MAX (__INT64_C(9223372036854775807)) 170 171 /* Maximum of fast unsigned integral types having a minimum size. */ 172 # define UINT_FAST8_MAX (255) 173 # if __WORDSIZE == 64 174 # define UINT_FAST16_MAX (18446744073709551615UL) 175 # define UINT_FAST32_MAX (18446744073709551615UL) 176 # else 177 # define UINT_FAST16_MAX (4294967295U) 178 # define UINT_FAST32_MAX (4294967295U) 179 # endif 180 # define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) 181 182 /* Values to test for integral types holding `void *' pointer. */ 183 # if __WORDSIZE == 64 184 # define INTPTR_MIN (-9223372036854775807L-1) 185 # define INTPTR_MAX (9223372036854775807L) 186 # define UINTPTR_MAX (18446744073709551615UL) 187 # else 188 # define INTPTR_MIN (-2147483647-1) 189 # define INTPTR_MAX (2147483647) 190 # define UINTPTR_MAX (4294967295U) 191 # endif 192 193 /* Minimum for largest signed integral type. */ 194 # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) 195 /* Maximum for largest signed integral type. */ 196 # define INTMAX_MAX (__INT64_C(9223372036854775807)) 197 198 /* Maximum for largest unsigned integral type. */ 199 # define UINTMAX_MAX (__UINT64_C(18446744073709551615)) 200 201 /* Limits of other integer types. */ 202 203 /* Limits of `ptrdiff_t' type. */ 204 # if __WORDSIZE == 64 205 # define PTRDIFF_MIN (-9223372036854775807L-1) 206 # define PTRDIFF_MAX (9223372036854775807L) 207 # else 208 # if __WORDSIZE32_PTRDIFF_LONG 209 # define PTRDIFF_MIN (-2147483647L-1) 210 # define PTRDIFF_MAX (2147483647L) 211 # else 212 # define PTRDIFF_MIN (-2147483647-1) 213 # define PTRDIFF_MAX (2147483647) 214 # endif 215 # endif 216 217 /* Limits of `sig_atomic_t'. */ 218 # define SIG_ATOMIC_MIN (-2147483647-1) 219 # define SIG_ATOMIC_MAX (2147483647) 220 221 /* Limit of `size_t' type. */ 222 # if __WORDSIZE == 64 223 # define SIZE_MAX (18446744073709551615UL) 224 # else 225 # if __WORDSIZE32_SIZE_ULONG 226 # define SIZE_MAX (4294967295UL) 227 # else 228 # define SIZE_MAX (4294967295U) 229 # endif 230 # endif 231 232 /* Limits of `wchar_t'. */ 233 # ifndef WCHAR_MIN 234 /* These constants might also be defined in <wchar.h>. */ 235 # define WCHAR_MIN __WCHAR_MIN 236 # define WCHAR_MAX __WCHAR_MAX 237 # endif 238 239 /* Limits of `wint_t'. */ 240 # define WINT_MIN (0u) 241 # define WINT_MAX (4294967295u) 242 243 /* Signed. */ 244 # define INT8_C(c) c 245 # define INT16_C(c) c 246 # define INT32_C(c) c 247 # if __WORDSIZE == 64 248 # define INT64_C(c) c ## L 249 # else 250 # define INT64_C(c) c ## LL 251 # endif 252 253 /* Unsigned. */ 254 # define UINT8_C(c) c 255 # define UINT16_C(c) c 256 # define UINT32_C(c) c ## U 257 # if __WORDSIZE == 64 258 # define UINT64_C(c) c ## UL 259 # else 260 # define UINT64_C(c) c ## ULL 261 # endif 262 263 /* Maximal type. */ 264 # if __WORDSIZE == 64 265 # define INTMAX_C(c) c ## L 266 # define UINTMAX_C(c) c ## UL 267 # else 268 # define INTMAX_C(c) c ## LL 269 # define UINTMAX_C(c) c ## ULL 270 # endif 271 272 #if __GLIBC_USE (IEC_60559_BFP_EXT) 273 274 # define INT8_WIDTH 8 275 # define UINT8_WIDTH 8 276 # define INT16_WIDTH 16 277 # define UINT16_WIDTH 16 278 # define INT32_WIDTH 32 279 # define UINT32_WIDTH 32 280 # define INT64_WIDTH 64 281 # define UINT64_WIDTH 64 282 283 # define INT_LEAST8_WIDTH 8 284 # define UINT_LEAST8_WIDTH 8 285 # define INT_LEAST16_WIDTH 16 286 # define UINT_LEAST16_WIDTH 16 287 # define INT_LEAST32_WIDTH 32 288 # define UINT_LEAST32_WIDTH 32 289 # define INT_LEAST64_WIDTH 64 290 # define UINT_LEAST64_WIDTH 64 291 292 # define INT_FAST8_WIDTH 8 293 # define UINT_FAST8_WIDTH 8 294 # define INT_FAST16_WIDTH __WORDSIZE 295 # define UINT_FAST16_WIDTH __WORDSIZE 296 # define INT_FAST32_WIDTH __WORDSIZE 297 # define UINT_FAST32_WIDTH __WORDSIZE 298 # define INT_FAST64_WIDTH 64 299 # define UINT_FAST64_WIDTH 64 300 301 # define INTPTR_WIDTH __WORDSIZE 302 # define UINTPTR_WIDTH __WORDSIZE 303 304 # define INTMAX_WIDTH 64 305 # define UINTMAX_WIDTH 64 306 307 # define PTRDIFF_WIDTH __WORDSIZE 308 # define SIG_ATOMIC_WIDTH 32 309 # define SIZE_WIDTH __WORDSIZE 310 # define WCHAR_WIDTH 32 311 # define WINT_WIDTH 32 312 313 #endif 314 315 #endif /* stdint.h */