Voxia OS
v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
type.h
Go to the documentation of this file.
1
#ifndef __TYPE_H__
2
#define __TYPE_H__
3
4
#ifdef __UINT8_TYPE__
5
typedef
__UINT8_TYPE__
uint8_t
;
6
#else
7
typedef
unsigned
char
uint8_t
;
8
#endif
9
10
#ifdef __UINT16_TYPE__
11
typedef
__UINT16_TYPE__
uint16_t
;
12
#else
13
typedef
unsigned
short
uint16_t
;
14
#endif
15
16
#ifdef __UINT32_TYPE__
17
typedef
__UINT32_TYPE__
uint32_t
;
18
#else
19
typedef
unsigned
int
uint32_t
;
20
#endif
21
22
#ifdef __UINT64_TYPE__
23
typedef
__UINT64_TYPE__
uint64_t
;
24
#else
25
typedef
unsigned
long
uint64_t
;
26
#endif
27
28
#ifdef __INT8_TYPE__
29
typedef
__INT8_TYPE__
int8_t
;
30
#else
31
typedef
signed
char
int8_t
;
32
#endif
33
34
#ifdef __INT16_TYPE__
35
typedef
__INT16_TYPE__
int16_t
;
36
#else
37
typedef
signed
short
int16_t
;
38
#endif
39
40
#ifdef __INT32_TYPE__
41
typedef
__INT32_TYPE__
int32_t
;
42
#else
43
typedef
signed
int
int32_t
;
44
#endif
45
46
#ifdef __INT64_TYPE__
47
typedef
__INT64_TYPE__
int64_t
;
48
#else
49
typedef
signed
long
int64_t
;
50
#endif
51
52
#ifdef __SIZE_TYPE__
53
typedef
__SIZE_TYPE__
size_t
;
54
#else
55
typedef
unsigned
long
size_t
;
56
#endif
57
58
#ifdef __PTRDIFF_TYPE__
59
typedef
__PTRDIFF_TYPE__
ptrdiff_t
;
60
#else
61
typedef
signed
long
ptrdiff_t
;
62
#endif
63
64
#ifdef __INTPTR_TYPE__
65
typedef
__INTPTR_TYPE__ intptr_t;
66
#else
67
#typedef signed long intptr_t;
68
#endif
69
70
#ifdef __UINTPTR_TYPE__
71
typedef
__UINTPTR_TYPE__
uintptr_t
;
72
#else
73
typedef
unsigned
long
uintptr_t
;
74
#endif
75
76
#define NULL 0
77
#define nullptr 0
78
79
typedef
struct
{
80
int
counter
;
81
}
atomic_t
;
82
83
// boolean
84
#define false 0
85
#define true 1
86
#ifdef __BOOL_TYPE__
87
typedef
__BOOL_TYPE__
boolean_t
;
88
#else
89
typedef
uint8_t
boolean_t
;
90
#endif
91
92
// TODO: move this to internal kernel
93
#define KERNEL_API \
94
__attribute__((used, visibility("default"), section(".export")))
95
96
#define DEPRECATED \
97
__attribute__((deprecated("This function is deprecated and may be " \
98
"removed in future versions.")))
99
100
#define UNUSED(x) (void)(x)
101
102
#if defined(__clang__) || defined(__GNUC__)
103
#define offsetof(type, member) __builtin_offsetof(type, member)
104
#else
105
#define offsetof(type, member) ((size_t) & (((type*) 0)->member))
106
#endif
107
108
#define container_of(ptr, type, member) \
109
((type*) ((uintptr_t) (ptr) - offsetof(type, member)))
110
111
#endif
// __TYPE_H__
atomic_t
Definition
type.h:79
atomic_t::counter
int counter
Definition
type.h:80
int16_t
signed short int16_t
Definition
type.h:37
ptrdiff_t
signed long ptrdiff_t
Definition
type.h:61
uint16_t
unsigned short uint16_t
Definition
type.h:13
uint32_t
unsigned int uint32_t
Definition
type.h:19
boolean_t
uint8_t boolean_t
Definition
type.h:89
uintptr_t
unsigned long uintptr_t
Definition
type.h:73
uint64_t
unsigned long uint64_t
Definition
type.h:25
int32_t
signed int int32_t
Definition
type.h:43
uint8_t
unsigned char uint8_t
Definition
type.h:7
size_t
unsigned long size_t
Definition
type.h:55
int64_t
signed long int64_t
Definition
type.h:49
int8_t
signed char int8_t
Definition
type.h:31
include
type.h
Generated on Sat May 30 2026 11:09:57 for Voxia OS by
1.13.2