xref: /haiku/headers/posix/stdint.h (revision f2ced752a08ff5d2618826bcd3ae3976c9f3e92e)
1 /*
2 ** Distributed under the terms of the Haiku License.
3 */
4 #ifndef _STDINT_H_
5 #define _STDINT_H_
6 
7 
8 /* ToDo: this is a compiler and architecture dependent header */
9 
10 /* Exact-width integer types */
11 
12 #define INT8_MIN 	(-128)
13 #define INT8_MAX 	(127)
14 #define UINT8_MAX	(255U)
15 
16 typedef signed char int8_t;
17 typedef unsigned char uint8_t;
18 
19 #define INT16_MIN 	(-32768)
20 #define INT16_MAX 	(32767)
21 #define UINT16_MAX	(65535U)
22 
23 typedef signed short int16_t;
24 typedef unsigned short uint16_t;
25 
26 #define INT32_MIN 	(-2147483648L)
27 #define INT32_MAX 	(2147483647L)
28 #define UINT32_MAX	(4294967295UL)
29 
30 typedef signed long int32_t;
31 typedef unsigned long uint32_t;
32 
33 #define INT64_MIN	(-9223372036854775808LL)
34 #define INT64_MAX	(9223372036854775807LL)
35 #define UINT64_MAX	(18446744073709551615ULL)
36 
37 typedef signed long long int64_t;
38 typedef unsigned long long uint64_t;
39 
40 
41 /* Minimum-width integer types */
42 
43 #define INT_LEAST8_MIN  	INT8_MIN
44 #define INT_LEAST8_MAX  	INT8_MAX
45 #define UINT_LEAST8_MAX 	UINT8_MAX
46 
47 typedef int8_t int_least8_t;
48 typedef uint8_t uint_least8_t;
49 
50 #define INT_LEAST16_MIN 	INT16_MIN
51 #define INT_LEAST16_MAX 	INT16_MAX
52 #define UINT_LEAST16_MAX	UINT16_MAX
53 
54 typedef int16_t int_least16_t;
55 typedef uint16_t uint_least16_t;
56 
57 #define INT_LEAST32_MIN 	INT32_MIN
58 #define INT_LEAST32_MAX 	INT32_MAX
59 #define UINT_LEAST32_MAX	UINT32_MAX
60 
61 typedef int32_t int_least32_t;
62 typedef uint32_t uint_least32_t;
63 
64 #define INT_LEAST64_MIN 	INT64_MIN
65 #define INT_LEAST64_MAX 	INT64_MAX
66 #define UINT_LEAST64_MAX	UINT64_MAX
67 
68 typedef int64_t int_least64_t;
69 typedef uint64_t uint_least64_t;
70 
71 
72 /* Fastest minimum-width integer types */
73 
74 #define INT_FAST8_MIN  	INT8_MIN
75 #define INT_FAST8_MAX  	INT8_MAX
76 #define UINT_FAST8_MAX 	UINT8_MAX
77 
78 typedef int32_t int_fast8_t;
79 typedef uint32_t uint_fast8_t;
80 
81 #define INT_FAST16_MIN 	INT16_MIN
82 #define INT_FAST16_MAX 	INT16_MAX
83 #define UINT_FAST16_MAX	UINT16_MAX
84 
85 typedef int32_t int_fast16_t;
86 typedef uint32_t uint_fast16_t;
87 
88 #define INT_FAST32_MIN 	INT32_MIN
89 #define INT_FAST32_MAX 	INT32_MAX
90 #define UINT_FAST32_MAX	UINT32_MAX
91 
92 typedef int32_t int_fast32_t;
93 typedef uint32_t uint_fast32_t;
94 
95 #define INT_FAST64_MIN 	INT64_MIN
96 #define INT_FAST64_MAX 	INT64_MAX
97 #define UINT_FAST64_MAX	UINT64_MAX
98 
99 typedef int64_t int_fast64_t;
100 typedef uint64_t uint_fast64_t;
101 
102 
103 /* Integer types capable of holding object pointers */
104 
105 #define INTPTR_MIN	INT32_MIN
106 #define INTPTR_MAX	INT32_MAX
107 #define UINTPTR_MAX	UINT32_MAX
108 
109 typedef int32_t intptr_t;
110 typedef uint32_t uintptr_t;
111 
112 
113 /* Greatest-width integer types */
114 
115 #define INTMAX_MIN	INT64_MIN
116 #define INTMAX_MAX	INT64_MAX
117 #define UINTMAX_MAX	UINT64_MAX
118 
119 typedef signed long long intmax_t;
120 typedef unsigned long long uintmax_t;
121 
122 
123 /* BSD compatibility */
124 
125 typedef uint8_t u_int8_t;
126 typedef uint16_t u_int16_t;
127 typedef uint32_t u_int32_t;
128 typedef uint64_t u_int64_t;
129 
130 #endif	/* _STDINT_H_ */
131