xref: /relibc/src/platform/types.rs (revision ae7cee26a661c02341332a200ddf03223a6fb362)
1 use core::i32;
2 
3 // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help enable
4 // more optimization opportunities around it recognizing things like
5 // malloc/free.
6 #[repr(u8)]
7 pub enum c_void {
8     // Two dummy variants so the #[repr] attribute can be used.
9     #[doc(hidden)]
10     __variant1,
11     #[doc(hidden)]
12     __variant2,
13 }
14 
15 pub type int8_t = i8;
16 pub type int16_t = i16;
17 pub type int32_t = i32;
18 pub type int64_t = i64;
19 pub type uint8_t = u8;
20 pub type uint16_t = u16;
21 pub type uint32_t = u32;
22 pub type uint64_t = u64;
23 
24 pub type c_schar = i8;
25 pub type c_uchar = u8;
26 pub type c_short = i16;
27 pub type c_ushort = u16;
28 pub type c_int = i32;
29 pub type c_uint = u32;
30 pub type c_float = f32;
31 pub type c_double = f64;
32 pub type c_longlong = i64;
33 pub type c_ulonglong = u64;
34 pub type intmax_t = i64;
35 pub type uintmax_t = u64;
36 
37 pub type size_t = usize;
38 pub type ptrdiff_t = isize;
39 pub type intptr_t = isize;
40 pub type uintptr_t = usize;
41 pub type ssize_t = isize;
42 
43 pub type c_char = i8;
44 pub type c_long = i64;
45 pub type c_ulong = u64;
46 
47 pub type wchar_t = i32;
48 pub type wint_t = u32;
49 
50 pub type regoff_t = size_t;
51 pub type off_t = c_long;
52 pub type mode_t = c_int;
53 pub type time_t = c_long;
54 pub type pid_t = c_int;
55 pub type id_t = c_uint;
56 pub type gid_t = c_int;
57 pub type uid_t = c_int;
58 pub type dev_t = c_long;
59 pub type ino_t = c_ulong;
60 pub type nlink_t = c_ulong;
61 pub type blksize_t = c_long;
62 pub type blkcnt_t = c_ulong;
63 
64 pub type fsblkcnt_t = c_ulong;
65 pub type fsfilcnt_t = c_ulong;
66 
67 pub type useconds_t = c_uint;
68 pub type suseconds_t = c_int;
69 
70 pub type clock_t = c_long;
71 pub type clockid_t = c_int;
72 pub type timer_t = *mut c_void;
73