XenevaOS
Loading...
Searching...
No Matches
stdint.h
Go to the documentation of this file.
1
30#ifndef __STDINT_H__
31#define __STDINT_H__
32
33#include <size_t.h>
34
35#define __need_wint_t
36#define __need_wchar_t
37
38
39/* 7.18.1.1 Exact-width integer types */
40typedef signed char int8_t;
41typedef unsigned char uint8_t;
42typedef short int16_t;
43typedef unsigned short uint16_t;
44typedef int int32_t;
45typedef unsigned uint32_t;
46typedef long long int64_t;
47typedef unsigned long long uint64_t;
48
49typedef uint8_t uint8;
53typedef int8_t int8;
54typedef int16_t int16;
55typedef int32_t int32;
56typedef int64_t int64;
57
58
59/* 7.18.1.2 Minimum-width integer types */
60typedef signed char int_least8_t;
61typedef unsigned char uint_least8_t;
62typedef short int_least16_t;
63typedef unsigned short uint_least16_t;
64typedef int int_least32_t;
65typedef unsigned uint_least32_t;
66typedef long long int_least64_t;
67typedef unsigned long long uint_least64_t;
68
69/* 7.18.1.3 Fastest minimum-width integer types
70* Not actually guaranteed to be fastest for all purposes
71* Here we use the exact-width types for 8 and 16-bit ints.
72*/
73typedef char int_fast8_t;
74typedef unsigned char uint_fast8_t;
75typedef short int_fast16_t;
76typedef unsigned short uint_fast16_t;
77typedef int int_fast32_t;
78typedef unsigned int uint_fast32_t;
79typedef long long int_fast64_t;
80typedef unsigned long long uint_fast64_t;
81
82/* 7.18.1.4 Integer types capable of holding object pointers */
83#if defined(ARCH_ARM64) || defined(__aarch64__) || defined(ARCH_X64) || defined(__x86_64__)
84typedef long long intptr_t;
85typedef unsigned long long uintptr_t;
86#else
87typedef int intptr_t;
88typedef unsigned int uintptr_t;
89#endif
90
91/* 7.18.1.5 Greatest-width integer types */
92typedef long long intmax_t;
93typedef unsigned long long uintmax_t;
94
95/* 7.18.2 Limits of specified-width integer types */
96#if defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
97
98/* 7.18.2.1 Limits of exact-width integer types */
99#define INT8_MIN (-128)
100#define INT16_MIN (-32768)
101#define INT32_MIN (-2147483647 - 1)
102#define INT64_MIN (-9223372036854775807LL - 1)
103
104#define INT8_MAX 127
105#define INT16_MAX 32767
106#define INT32_MAX 2147483647
107#define INT64_MAX 9223372036854775807LL
108
109#define UINT8_MAX 0xff /* 255U */
110#define UINT16_MAX 0xffff /* 65535U */
111#define UINT32_MAX 0xffffffff /* 4294967295U */
112#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
113
114/* 7.18.2.2 Limits of minimum-width integer types */
115#define INT_LEAST8_MIN INT8_MIN
116#define INT_LEAST16_MIN INT16_MIN
117#define INT_LEAST32_MIN INT32_MIN
118#define INT_LEAST64_MIN INT64_MIN
119
120#define INT_LEAST8_MAX INT8_MAX
121#define INT_LEAST16_MAX INT16_MAX
122#define INT_LEAST32_MAX INT32_MAX
123#define INT_LEAST64_MAX INT64_MAX
124
125#define UINT_LEAST8_MAX UINT8_MAX
126#define UINT_LEAST16_MAX UINT16_MAX
127#define UINT_LEAST32_MAX UINT32_MAX
128#define UINT_LEAST64_MAX UINT64_MAX
129
130/* 7.18.2.3 Limits of fastest minimum-width integer types */
131#define INT_FAST8_MIN INT8_MIN
132#define INT_FAST16_MIN INT16_MIN
133#define INT_FAST32_MIN INT32_MIN
134#define INT_FAST64_MIN INT64_MIN
135
136#define INT_FAST8_MAX INT8_MAX
137#define INT_FAST16_MAX INT16_MAX
138#define INT_FAST32_MAX INT32_MAX
139#define INT_FAST64_MAX INT64_MAX
140
141#define UINT_FAST8_MAX UINT8_MAX
142#define UINT_FAST16_MAX UINT16_MAX
143#define UINT_FAST32_MAX UINT32_MAX
144#define UINT_FAST64_MAX UINT64_MAX
145
146/* 7.18.2.4 Limits of integer types capable of holding
147object pointers */
148#define INTPTR_MIN INT32_MIN
149#define INTPTR_MAX INT32_MAX
150#define UINTPTR_MAX UINT32_MAX
151
152/* 7.18.2.5 Limits of greatest-width integer types */
153#define INTMAX_MIN INT64_MIN
154#define INTMAX_MAX INT64_MAX
155#define UINTMAX_MAX UINT64_MAX
156
157/* 7.18.3 Limits of other integer types */
158#define PTRDIFF_MIN INT32_MIN
159#define PTRDIFF_MAX INT32_MAX
160
161#define SIG_ATOMIC_MIN INT32_MIN
162#define SIG_ATOMIC_MAX INT32_MAX
163
164#define SIZE_MAX 0xFFFFF //UINT32_MAX
165
166#ifndef WCHAR_MIN /* also in wchar.h */
167#define WCHAR_MIN 0
168#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
169#endif
170
171/*
172* wint_t is unsigned short for compatibility with MS runtime
173*/
174#define WINT_MIN 0
175#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */
176
177#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
178
179
180/* 7.18.4 Macros for integer constants */
181#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
182
183/* 7.18.4.1 Macros for minimum-width integer constants */
184
185#define INT8_C(val) ((int8_t) + (val))
186#define UINT8_C(val) ((uint8_t) + (val##U))
187#define INT16_C(val) ((int16_t) + (val))
188#define UINT16_C(val) ((uint16_t) + (val##U))
189
190#define INT32_C(val) val##L
191#define UINT32_C(val) val##UL
192#define INT64_C(val) val##LL
193#define UINT64_C(val) val##ULL
194
195/* 7.18.4.2 Macros for greatest-width integer constants */
196#define INTMAX_C(val) INT64_C(val)
197#define UINTMAX_C(val) UINT64_C(val)
198
199#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
200
201#ifdef __cplusplus
202extern "C++" {
203 template <class T, class U> intptr_t raw_diff(T* p1, U* p2)
204 {
205 return (intptr_t)p1 - (intptr_t)p2;
206 }
207 template <class T, class U> T raw_offset(U p1, const intptr_t offset)
208 {
209 return (T)((size_t)p1 + offset);
210 }
211 template <class T, class U> T mem_after(U* p1)
212 {
213 return (T)(&p1[1]);
214 }
215}
216#else
217#define RAW_OFFSET(type, x, offset) (type)((size_t)x + offset)
218#endif
219
220#define DIV_ROUND_UP(x, y) \
221 ((x + y - 1) / y)
222
223#define ALIGN_UP(x, y) (DIV_ROUND_UP(x,y)*y)
224
225#define NULL 0
226
227#define bool char
228#endif
long long int_least64_t
Definition stdint.h:73
int intptr_t
Definition stdint.h:93
uint64_t size_t
Definition stdint.h:104
unsigned short uint16_t
Definition stdint.h:50
unsigned char uint_fast8_t
Definition stdint.h:81
unsigned uint32_t
Definition stdint.h:52
int int32_t
Definition stdint.h:51
uint8_t uint8
Definition stdint.h:56
unsigned int uint_fast32_t
Definition stdint.h:85
int int_least32_t
Definition stdint.h:71
unsigned int uintptr_t
Definition stdint.h:94
unsigned long long uintmax_t
Definition stdint.h:99
int64_t int64
Definition stdint.h:63
short int_least16_t
Definition stdint.h:69
long long int_fast64_t
Definition stdint.h:86
long long int64_t
Definition stdint.h:53
int int_fast32_t
Definition stdint.h:84
unsigned long long uint_least64_t
Definition stdint.h:74
int16_t int16
Definition stdint.h:61
short int16_t
Definition stdint.h:49
int8_t int8
Definition stdint.h:60
unsigned long long uint64_t
Definition stdint.h:54
unsigned uint_least32_t
Definition stdint.h:72
unsigned short uint_fast16_t
Definition stdint.h:83
unsigned char uint_least8_t
Definition stdint.h:68
unsigned long long uint_fast64_t
Definition stdint.h:87
int32_t int32
Definition stdint.h:62
unsigned char uint8_t
Definition stdint.h:48
uint64_t uint64
Definition stdint.h:59
uint16_t uint16
Definition stdint.h:57
long long intmax_t
Definition stdint.h:98
uint32_t uint32
Definition stdint.h:58
unsigned short uint_least16_t
Definition stdint.h:70
signed char int_least8_t
Definition stdint.h:67
signed char int8_t
Definition stdint.h:47
char int_fast8_t
Definition stdint.h:80
short int_fast16_t
Definition stdint.h:82
std::ptrdiff_t raw_diff(T p1, T p2)
Definition Common.hpp:26
T raw_offset(U p1, std::ptrdiff_t offset)
Definition Common.hpp:41
T mem_after(T p1)
Definition Common.hpp:58
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_INT64 int64_t
Definition acefiex.h:164
short int int16_t
Definition acefiex.h:159
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
signed char int8_t
Definition acefiex.h:158