1 #ifndef _STDINT_H_ 2 #define _STDINT_H_ 3 /* 4 ** Distributed under the terms of the OpenBeOS License. 5 */ 6 7 typedef signed char int8_t; 8 #define INT8_MIN (-128) 9 #define INT8_MAX (127) 10 typedef unsigned char uint8_t; 11 #define UINT8_MIN (0U) 12 #define UINT8_MAX (255U) 13 14 typedef signed short int16_t; 15 #define INT16_MIN (-32768) 16 #define INT16_MAX (32767) 17 typedef unsigned short uint16_t; 18 #define UINT16_MIN (0U) 19 #define UINT16_MAX (65535U) 20 21 typedef signed long int32_t; 22 #define INT32_MIN (-2147483648L) 23 #define INT32_MAX (2147483647L) 24 typedef unsigned long uint32_t; 25 #define UINT32_MIN (0UL) 26 #define UINT32_MAX (4294967295UL) 27 28 typedef signed long long int64_t; 29 #define INT64_MIN (-9223372036854775808LL) 30 #define INT64_MAX (9223372036854775807LL) 31 typedef unsigned long long uint64_t; 32 #define UINT64_MIN (0ULL) 33 #define UINT64_MAX (18446744073709551615ULL) 34 35 typedef signed long long intmax_t; 36 #define INTMAX_MIN INT64_MIN 37 #define INTMAX_MAX INT64_MAX 38 typedef unsigned long long uintmax_t; 39 #define UINTMAX_MIN UINT64_MIN 40 #define UINTMAX_MAX UINT64_MAX 41 42 // least types 43 44 typedef int8_t int_least8_t; 45 #define INT_LEAST8_MIN INT8_MIN 46 #define INT_LEAST8_MAX INT8_MAX 47 typedef uint8_t uint_least8_t; 48 #define UINT_LEAST8_MIN UINT8_MIN 49 #define UINT_LEAST8_MAX UINT8_MAX 50 51 typedef int16_t int_least16_t; 52 #define INT_LEAST16_MIN INT16_MIN 53 #define INT_LEAST16_MAX INT16_MAX 54 typedef uint16_t uint_least16_t; 55 #define UINT_LEAST16_MIN UINT16_MIN 56 #define UINT_LEAST16_MAX UINT16_MAX 57 58 typedef int32_t int_least32_t; 59 #define INT_LEAST32_MIN INT32_MIN 60 #define INT_LEAST32_MAX INT32_MAX 61 typedef uint32_t uint_least32_t; 62 #define UINT_LEAST32_MIN UINT32_MIN 63 #define UINT_LEAST32_MAX UINT32_MAX 64 65 typedef int64_t int_least64_t; 66 #define INT_LEAST64_MIN INT64_MIN 67 #define INT_LEAST64_MAX INT64_MAX 68 typedef uint64_t uint_least64_t; 69 #define UINT_LEAST64_MIN UINT64_MIN 70 #define UINT_LEAST64_MAX UINT64_MAX 71 72 73 // fast types assume a 32-bit processor 74 75 typedef int32_t int_fast8_t; 76 #define INT_FAST8_MIN INT8_MIN 77 #define INT_FAST8_MAX INT8_MAX 78 typedef uint32_t uint_fast8_t; 79 #define UINT_FAST8_MIN UINT8_MIN 80 #define UINT_FAST8_MAX UINT8_MAX 81 82 typedef int32_t int_fast16_t; 83 #define INT_FAST16_MIN INT16_MIN 84 #define INT_FAST16_MAX INT16_MAX 85 typedef uint32_t uint_fast16_t; 86 #define UINT_FAST16_MIN UINT16_MIN 87 #define UINT_FAST16_MAX UINT16_MAX 88 89 typedef int32_t int_fast32_t; 90 #define INT_FAST32_MIN INT32_MIN 91 #define INT_FAST32_MAX INT32_MAX 92 typedef uint32_t uint_fast32_t; 93 #define UINT_FAST32_MIN UINT32_MIN 94 #define UINT_FAST32_MAX UINT32_MAX 95 96 typedef int64_t int_fast64_t; 97 #define INT_FAST64_MIN INT64_MIN 98 #define INT_FAST64_MAX INT64_MAX 99 typedef uint64_t uint_fast64_t; 100 #define UINT_FAST64_MIN UINT64_MIN 101 #define UINT_FAST64_MAX UINT64_MAX 102 103 /* BSD compatibility */ 104 typedef uint8_t u_int8_t; 105 typedef uint16_t u_int16_t; 106 typedef uint32_t u_int32_t; 107 typedef uint64_t u_int64_t; 108 109 #endif /* _STDINT_H_ */ 110