The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
stdint.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* fixed-width integer types.
5
*/
6
// fixed-width types, pinned to the same C types on every target we build
7
// for (i686 ILP32 and x86_64 LP64), so one printf format fits each:
8
// %u/%x for uint32_t, %llu/%llx for uint64_t. pointer-width types below
9
// (uintptr_t, size_t) are unsigned long on both: %lx, %zu.
10
typedef
signed
char
int8_t
;
11
typedef
unsigned
char
uint8_t
;
12
typedef
short
int16_t
;
13
typedef
unsigned
short
uint16_t
;
14
typedef
int
int32_t
;
15
typedef
unsigned
int
uint32_t
;
16
typedef
long
long
int64_t
;
17
typedef
unsigned
long
long
uint64_t
;
18
19
_Static_assert
(
sizeof
(
int32_t
) == 4 &&
sizeof
(
uint64_t
) == 8,
"fixed-width types"
);
20
21
// integers wide enough to hold a pointer: the only way pointers and integers
22
// should be converted. the compiler names the right type for each target.
23
typedef
__INTPTR_TYPE__
intptr_t
;
24
typedef
__UINTPTR_TYPE__
uintptr_t
;
25
26
#define UINTPTR_MAX __UINTPTR_MAX__
27
#define UINT16_MAX 0xFFFF
28
#define UINT32_MAX 0xFFFFFFFFu
29
#define UINT64_MAX 0xFFFFFFFFFFFFFFFFull
30
#define INT32_MAX 0x7FFFFFFF
31
#define INT64_MAX 0x7FFFFFFFFFFFFFFFll
32
33
typedef
uint8_t
bool
;
34
35
#define false 0
36
#define true 1
37
38
#include "
common/stddef.h
"
stddef.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint8_t
unsigned char uint8_t
Definition
fb.h:18
intptr_t
__INTPTR_TYPE__ intptr_t
Definition
stdint.h:18
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
uint16_t
unsigned short uint16_t
Definition
stdint.h:13
int32_t
int int32_t
Definition
stdint.h:14
uintptr_t
__UINTPTR_TYPE__ uintptr_t
Definition
stdint.h:19
int16_t
short int16_t
Definition
stdint.h:12
int64_t
__INT64_TYPE__ int64_t
Definition
stdint.h:16
int8_t
signed char int8_t
fixed-width integer types.
Definition
stdint.h:10
bool
#define bool
Definition
stdbool.h:8
src
common
stdint.h
Generated by
1.18.0