1 //! SGX C types definition 2 3 pub type int8_t = i8; 4 pub type int16_t = i16; 5 pub type int32_t = i32; 6 pub type int64_t = i64; 7 pub type uint8_t = u8; 8 pub type uint16_t = u16; 9 pub type uint32_t = u32; 10 pub type uint64_t = u64; 11 12 pub type c_schar = i8; 13 pub type c_uchar = u8; 14 pub type c_short = i16; 15 pub type c_ushort = u16; 16 pub type c_int = i32; 17 pub type c_uint = u32; 18 pub type c_float = f32; 19 pub type c_double = f64; 20 pub type c_longlong = i64; 21 pub type c_ulonglong = u64; 22 pub type intmax_t = i64; 23 pub type uintmax_t = u64; 24 25 pub type size_t = usize; 26 pub type ptrdiff_t = isize; 27 pub type intptr_t = isize; 28 pub type uintptr_t = usize; 29 pub type ssize_t = isize; 30 31 pub type c_char = i8; 32 pub type c_long = i64; 33 pub type c_ulong = u64; 34 35 pub const INT_MIN: c_int = -2147483648; 36 pub const INT_MAX: c_int = 2147483647; 37 38 cfg_if! { 39 if #[cfg(core_cvoid)] { 40 pub use core::ffi::c_void; 41 } else { 42 // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 43 // enable more optimization opportunities around it recognizing things 44 // like malloc/free. 45 #[repr(u8)] 46 pub enum c_void { 47 // Two dummy variants so the #[repr] attribute can be used. 48 #[doc(hidden)] 49 __variant1, 50 #[doc(hidden)] 51 __variant2, 52 } 53 } 54 } 55