PatchworkOS
Loading...
Searching...
No Matches
stdint.h
Go to the documentation of this file.
1#ifndef _STDINT_H
2#define _STDINT_H 1
3
4#if defined(__cplusplus)
5extern "C"
6{
7#endif
8
9/* 7.18.1.1 Exact-width integer types */
10typedef __INT8_TYPE__ int8_t;
11typedef __UINT8_TYPE__ uint8_t;
12typedef __INT16_TYPE__ int16_t;
13typedef __UINT16_TYPE__ uint16_t;
14typedef __INT32_TYPE__ int32_t;
15typedef __UINT32_TYPE__ uint32_t;
16typedef __INT64_TYPE__ int64_t;
17typedef __UINT64_TYPE__ uint64_t;
18
19/* 7.18.1.2 Minimum-width integer types */
20typedef __INT_LEAST8_TYPE__ int_least8_t;
21typedef __INT_LEAST16_TYPE__ int_least16_t;
22typedef __INT_LEAST32_TYPE__ int_least32_t;
23typedef __INT_LEAST64_TYPE__ int_least64_t;
24
25typedef __UINT_LEAST8_TYPE__ uint_least8_t;
26typedef __UINT_LEAST16_TYPE__ uint_least16_t;
27typedef __UINT_LEAST32_TYPE__ uint_least32_t;
28typedef __UINT_LEAST64_TYPE__ uint_least64_t;
29
30/* 7.18.1.3 Fastest minimum-width integer types */
31typedef __INT_FAST8_TYPE__ int_fast8_t;
32typedef __INT_FAST16_TYPE__ int_fast16_t;
33typedef __INT_FAST32_TYPE__ int_fast32_t;
34typedef __INT_FAST64_TYPE__ int_fast64_t;
35
36typedef __UINT_FAST8_TYPE__ uint_fast8_t;
37typedef __UINT_FAST16_TYPE__ uint_fast16_t;
38typedef __UINT_FAST32_TYPE__ uint_fast32_t;
39typedef __UINT_FAST64_TYPE__ uint_fast64_t;
40
41/* 7.18.1.4 Integer types capable of holding object pointers */
42typedef __INTPTR_TYPE__ intptr_t;
43typedef __UINTPTR_TYPE__ uintptr_t;
44
45/* 7.18.1.5 Greatest-width integer types */
46typedef __INTMAX_TYPE__ intmax_t;
47typedef __UINTMAX_TYPE__ uintmax_t;
48
49/* 7.18.2 Limits of specified-width integer types */
50
51#if defined(__cplusplus) && __cplusplus < 201103L
52#ifndef __STDC_LIMIT_MACROS
53#define _NO_LIMIT_MACROS
54#endif
55#endif
56
57#ifndef _NO_LIMIT_MACROS
58
59/* 7.18.2.1 Limits of exact-width integer types */
60#define INT8_MIN (-__INT8_MAX__ - 1)
61#define INT8_MAX __INT8_MAX__
62#define UINT8_MAX __UINT8_MAX__
63
64#define INT16_MIN (-__INT16_MAX__ - 1)
65#define INT16_MAX __INT16_MAX__
66#define UINT16_MAX __UINT16_MAX__
67
68#define INT32_MIN (-__INT32_MAX__ - 1)
69#define INT32_MAX __INT32_MAX__
70#define UINT32_MAX __UINT32_MAX__
71
72#define INT64_MIN (-__INT64_MAX__ - 1)
73#define INT64_MAX __INT64_MAX__
74#define UINT64_MAX __UINT64_MAX__
75
76/* 7.18.2.2 Limits of minimum-width integer types */
77#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1)
78#define INT_LEAST8_MAX __INT_LEAST8_MAX__
79#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
80
81#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1)
82#define INT_LEAST16_MAX __INT_LEAST16_MAX__
83#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
84
85#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1)
86#define INT_LEAST32_MAX __INT_LEAST32_MAX__
87#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
88
89#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1)
90#define INT_LEAST64_MAX __INT_LEAST64_MAX__
91#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
92
93/* 7.18.2.3 Limits of fastest minimum-width integer types */
94#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1)
95#define INT_FAST8_MAX __INT_FAST8_MAX__
96#define UINT_FAST8_MAX __UINT_FAST8_MAX__
97
98#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1)
99#define INT_FAST16_MAX __INT_FAST16_MAX__
100#define UINT_FAST16_MAX __UINT_FAST16_MAX__
101
102#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1)
103#define INT_FAST32_MAX __INT_FAST32_MAX__
104#define UINT_FAST32_MAX __UINT_FAST32_MAX__
105
106#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1)
107#define INT_FAST64_MAX __INT_FAST64_MAX__
108#define UINT_FAST64_MAX __UINT_FAST64_MAX__
109
110/* 7.18.2.4 Limits of integer types capable of holding object pointers */
111#define INTPTR_MIN (-__INTPTR_MAX__ - 1)
112#define INTPTR_MAX __INTPTR_MAX__
113#define UINTPTR_MAX __UINTPTR_MAX__
114
115/* 7.18.2.5 Limits of greatest-width integer types */
116#define INTMAX_MIN (-__INTMAX_MAX__ - 1)
117#define INTMAX_MAX __INTMAX_MAX__
118#define UINTMAX_MAX __UINTMAX_MAX__
119
120/* 7.18.3 Limits of other integer types */
121#define PTRDIFF_MIN (-__PTRDIFF_MAX__ - 1)
122#define PTRDIFF_MAX __PTRDIFF_MAX__
123
124#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
125#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
126
127#define SIZE_MAX __SIZE_MAX__
128
129#define WCHAR_MIN __WCHAR_MIN__
130#define WCHAR_MAX __WCHAR_MAX__
131
132#define WINT_MIN __WINT_MIN__
133#define WINT_MAX __WINT_MAX__
134
135#endif
136
137/* 7.18.4 Macros for integer constants */
138
139#if defined(__cplusplus) && __cplusplus < 201103L
140#ifndef __STDC_CONSTANT_MACROS
141#define _NO_CONSTANT_MACROS
142#endif
143#endif
144
145#ifndef _NO_CONSTANT_MACROS
146
147#define INT8_C(value) __INT8_C(value)
148#define INT16_C(value) __INT16_C(value)
149#define INT32_C(value) __INT32_C(value)
150#define INT64_C(value) __INT64_C(value)
151
152#define UINT8_C(value) __UINT8_C(value)
153#define UINT16_C(value) __UINT16_C(value)
154#define UINT32_C(value) __UINT32_C(value)
155#define UINT64_C(value) __UINT64_C(value)
156
157#define INTMAX_C(value) __INTMAX_C(value)
158
159#define UINTMAX_C(value) __UINTMAX_C(value)
160
161#endif
162
163#if _USE_ANNEX_K == 1
164#define RSIZE_MAX (__SIZE_MAX__ >> 1)
165#endif
166
167#if defined(__cplusplus)
168}
169#endif
170
171#endif
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
__INTPTR_TYPE__ intptr_t
Definition stdint.h:42
__INT32_TYPE__ int32_t
Definition stdint.h:14
__UINT_LEAST16_TYPE__ uint_least16_t
Definition stdint.h:26
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT_FAST8_TYPE__ uint_fast8_t
Definition stdint.h:36
__INT_LEAST16_TYPE__ int_least16_t
Definition stdint.h:21
__UINT8_TYPE__ uint8_t
Definition stdint.h:11
__INT_LEAST32_TYPE__ int_least32_t
Definition stdint.h:22
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:43
__UINTMAX_TYPE__ uintmax_t
Definition stdint.h:47
__INT_FAST32_TYPE__ int_fast32_t
Definition stdint.h:33
__UINT16_TYPE__ uint16_t
Definition stdint.h:13
__UINT_LEAST8_TYPE__ uint_least8_t
Definition stdint.h:25
__UINT_FAST64_TYPE__ uint_fast64_t
Definition stdint.h:39
__UINT_LEAST32_TYPE__ uint_least32_t
Definition stdint.h:27
__INT_FAST16_TYPE__ int_fast16_t
Definition stdint.h:32
__INT_LEAST64_TYPE__ int_least64_t
Definition stdint.h:23
__INT_FAST8_TYPE__ int_fast8_t
Definition stdint.h:31
__UINT_FAST32_TYPE__ uint_fast32_t
Definition stdint.h:38
__UINT_FAST16_TYPE__ uint_fast16_t
Definition stdint.h:37
__UINT_LEAST64_TYPE__ uint_least64_t
Definition stdint.h:28
__INT_FAST64_TYPE__ int_fast64_t
Definition stdint.h:34
__INT64_TYPE__ int64_t
Definition stdint.h:16
__INT8_TYPE__ int8_t
Definition stdint.h:10
__INT_LEAST8_TYPE__ int_least8_t
Definition stdint.h:20
__INTMAX_TYPE__ intmax_t
Definition stdint.h:46
__INT16_TYPE__ int16_t
Definition stdint.h:12