1#ifndef _LIBC_STDINT_H
2#define _LIBC_STDINT_H
3
4#include <bits/types.h>
5#include <sys/cdefs.h>
6
7__BEGIN_DECLS
8
9#ifndef __stdints_defined
10#define __stdints_defined
11typedef __int8_t int8_t;
12typedef __int16_t int16_t;
13typedef __int32_t int32_t;
14typedef __int64_t int64_t;
15typedef __uint8_t uint8_t;
16typedef __uint16_t uint16_t;
17typedef __uint32_t uint32_t;
18typedef __uint64_t uint64_t;
19#endif // __stdints_defined
20
21#ifndef __stdleastints_defined
22#define __stdleastints_defined
23typedef int8_t int_least8_t;
24typedef int16_t int_least16_t;
25typedef int32_t int_least32_t;
26typedef int64_t int_least64_t;
27typedef uint8_t uint_least8_t;
28typedef uint16_t uint_least16_t;
29typedef uint32_t uint_least32_t;
30typedef uint64_t uint_least64_t;
31#endif // __stdleastints_defined
32
33// TODO: Optimize for 64bit systems.
34#ifndef __stdfastints_defined
35#define __stdfastints_defined
36typedef int32_t int_fast8_t;
37typedef int32_t int_fast16_t;
38typedef int32_t int_fast32_t;
39typedef int64_t int_fast64_t;
40typedef uint32_t uint_fast8_t;
41typedef uint32_t uint_fast16_t;
42typedef uint32_t uint_fast32_t;
43typedef uint64_t uint_fast64_t;
44#endif // __stdfastints_defined
45
46#ifndef __stdptrints_defined
47#define __stdptrints_defined
48typedef int32_t intptr_t;
49typedef uint32_t uintptr_t;
50#endif // __stdptrints_defined
51
52#ifndef __stdmaxints_defined
53#define __stdmaxints_defined
54typedef int64_t intmax_t;
55#endif // __stdmaxints_defined
56
57#ifndef __stdintmacroses_defined
58#define __stdintmacroses_defined
59#define INT8_MAX 0x7f
60#define INT8_MIN (-INT8_MAX - 1)
61#define UINT8_MAX (INT8_MAX * 2 + 1)
62
63#define INT16_MAX 0x7fff
64#define INT16_MIN (-INT16_MAX - 1)
65#define UINT16_MAX (INT16_MAX * 2U + 1U)
66
67#define INT32_MAX 0x7fffffffL
68#define INT32_MIN (-INT32_MAX - 1L)
69#define UINT32_MAX (INT32_MAX * 2UL + 1UL)
70
71#define INT64_MAX 0x7fffffffffffffffLL
72#define INT64_MIN (-INT64_MAX - 1LL)
73#define UINT64_MAX (INT64_MAX * 2ULL + 1ULL)
74
75#define INT_LEAST8_MAX INT8_MAX
76#define INT_LEAST8_MIN INT8_MIN
77#define UINT_LEAST8_MAX UINT8_MAX
78#define INT_LEAST16_MAX INT16_MAX
79#define INT_LEAST16_MIN INT16_MIN
80#define UINT_LEAST16_MAX UINT16_MAX
81#define INT_LEAST32_MAX INT32_MAX
82#define INT_LEAST32_MIN INT32_MIN
83#define UINT_LEAST32_MAX UINT32_MAX
84#define INT_LEAST64_MAX INT64_MAX
85#define INT_LEAST64_MIN INT64_MIN
86#define UINT_LEAST64_MAX UINT64_MAX
87
88#define INT_FAST8_MAX INT8_MAX
89#define INT_FAST8_MIN INT8_MIN
90#define UINT_FAST8_MAX UINT8_MAX
91#define INT_FAST16_MAX INT16_MAX
92#define INT_FAST16_MIN INT16_MIN
93#define UINT_FAST16_MAX UINT16_MAX
94#define INT_FAST32_MAX INT32_MAX
95#define INT_FAST32_MIN INT32_MIN
96#define UINT_FAST32_MAX UINT32_MAX
97#define INT_FAST64_MAX INT64_MAX
98#define INT_FAST64_MIN INT64_MIN
99#define UINT_FAST64_MAX UINT64_MAX
100#endif // __stdintmacroses_defined
101
102__END_DECLS
103
104#endif //_LIBC_STDINT_H