The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
stdint.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file stdint.h
5 * @brief integer types of fixed width. the types are the compiler's own
6 * (__INT64_TYPE__ and so on), so they agree with it on both
7 * architectures: int64_t is long long on i686 and long on x86_64.
8 */
9
10typedef signed char int8_t;
11typedef unsigned char uint8_t;
12typedef short int16_t;
13typedef unsigned short uint16_t;
14typedef int int32_t;
15typedef unsigned int uint32_t;
16typedef __INT64_TYPE__ int64_t;
17typedef __UINT64_TYPE__ uint64_t;
18typedef __INTPTR_TYPE__ intptr_t;
19typedef __UINTPTR_TYPE__ uintptr_t;
20typedef __INTMAX_TYPE__ intmax_t;
21typedef __UINTMAX_TYPE__ uintmax_t;
22
23// the smallest types of at least a width, and the fastest ones
24typedef __INT_LEAST8_TYPE__ int_least8_t;
25typedef __UINT_LEAST8_TYPE__ uint_least8_t;
26typedef __INT_LEAST16_TYPE__ int_least16_t;
27typedef __UINT_LEAST16_TYPE__ uint_least16_t;
28typedef __INT_LEAST32_TYPE__ int_least32_t;
29typedef __UINT_LEAST32_TYPE__ uint_least32_t;
30typedef __INT_LEAST64_TYPE__ int_least64_t;
31typedef __UINT_LEAST64_TYPE__ uint_least64_t;
32typedef __INT_FAST8_TYPE__ int_fast8_t;
33typedef __UINT_FAST8_TYPE__ uint_fast8_t;
34typedef __INT_FAST16_TYPE__ int_fast16_t;
35typedef __UINT_FAST16_TYPE__ uint_fast16_t;
36typedef __INT_FAST32_TYPE__ int_fast32_t;
37typedef __UINT_FAST32_TYPE__ uint_fast32_t;
38typedef __INT_FAST64_TYPE__ int_fast64_t;
39typedef __UINT_FAST64_TYPE__ uint_fast64_t;
40
41#define INT8_MIN (-128)
42#define INT8_MAX 127
43#define UINT8_MAX 255
44#define INT16_MIN (-32768)
45#define INT16_MAX 32767
46#define UINT16_MAX 65535
47#define INT32_MIN (-2147483647 - 1)
48#define INT32_MAX 2147483647
49#define UINT32_MAX 4294967295u
50#define INT64_MAX __INT64_MAX__
51#define INT64_MIN (-INT64_MAX - 1)
52#define UINT64_MAX __UINT64_MAX__
53#define INTMAX_MAX __INTMAX_MAX__
54#define INTMAX_MIN (-INTMAX_MAX - 1)
55#define UINTMAX_MAX __UINTMAX_MAX__
56#define INT64_C(c) __INT64_C(c)
57#define UINT64_C(c) __UINT64_C(c)
58#define INTPTR_MAX __INTPTR_MAX__
59#define INTPTR_MIN (-INTPTR_MAX - 1)
60#define UINTPTR_MAX __UINTPTR_MAX__
61#define SIZE_MAX __SIZE_MAX__
62#define PTRDIFF_MAX __PTRDIFF_MAX__
63#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
64#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
65#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
66#define WCHAR_MAX __WCHAR_MAX__
67#define WCHAR_MIN __WCHAR_MIN__
68#define WINT_MAX __WINT_MAX__
69#define WINT_MIN __WINT_MIN__
70
71#define INT_LEAST8_MAX __INT_LEAST8_MAX__
72#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
73#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
74#define INT_LEAST16_MAX __INT_LEAST16_MAX__
75#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
76#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
77#define INT_LEAST32_MAX __INT_LEAST32_MAX__
78#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
79#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
80#define INT_LEAST64_MAX __INT_LEAST64_MAX__
81#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
82#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
83#define INT_FAST8_MAX __INT_FAST8_MAX__
84#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
85#define UINT_FAST8_MAX __UINT_FAST8_MAX__
86#define INT_FAST16_MAX __INT_FAST16_MAX__
87#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
88#define UINT_FAST16_MAX __UINT_FAST16_MAX__
89#define INT_FAST32_MAX __INT_FAST32_MAX__
90#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
91#define UINT_FAST32_MAX __UINT_FAST32_MAX__
92#define INT_FAST64_MAX __INT_FAST64_MAX__
93#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
94#define UINT_FAST64_MAX __UINT_FAST64_MAX__
95
96// constants of the least types and intmax_t
97#define INT8_C(c) __INT8_C(c)
98#define UINT8_C(c) __UINT8_C(c)
99#define INT16_C(c) __INT16_C(c)
100#define UINT16_C(c) __UINT16_C(c)
101#define INT32_C(c) __INT32_C(c)
102#define UINT32_C(c) __UINT32_C(c)
103#define INTMAX_C(c) __INTMAX_C(c)
104#define UINTMAX_C(c) __UINTMAX_C(c)
unsigned int uint32_t
Definition fb.h:17
unsigned char uint8_t
Definition fb.h:18
__INTPTR_TYPE__ intptr_t
Definition stdint.h:18
__UINT_LEAST16_TYPE__ uint_least16_t
Definition stdint.h:27
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT_FAST8_TYPE__ uint_fast8_t
Definition stdint.h:33
unsigned short uint16_t
Definition stdint.h:13
int int32_t
Definition stdint.h:14
__INT_LEAST16_TYPE__ int_least16_t
Definition stdint.h:26
__INT_LEAST32_TYPE__ int_least32_t
Definition stdint.h:28
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:19
__UINTMAX_TYPE__ uintmax_t
Definition stdint.h:21
__INT_FAST32_TYPE__ int_fast32_t
Definition stdint.h:36
__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:29
__INT_FAST16_TYPE__ int_fast16_t
Definition stdint.h:34
__INT_LEAST64_TYPE__ int_least64_t
Definition stdint.h:30
__INT_FAST8_TYPE__ int_fast8_t
Definition stdint.h:32
short int16_t
Definition stdint.h:12
__UINT_FAST32_TYPE__ uint_fast32_t
Definition stdint.h:37
__UINT_FAST16_TYPE__ uint_fast16_t
Definition stdint.h:35
__UINT_LEAST64_TYPE__ uint_least64_t
Definition stdint.h:31
__INT_FAST64_TYPE__ int_fast64_t
Definition stdint.h:38
__INT64_TYPE__ int64_t
Definition stdint.h:16
__INT_LEAST8_TYPE__ int_least8_t
Definition stdint.h:24
__INTMAX_TYPE__ intmax_t
Definition stdint.h:20
signed char int8_t
fixed-width integer types.
Definition stdint.h:10