mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-09-13 02:24:55 +00:00
d5f5648b37
We use cargo vendor to generate a .cargo/config file and the vendor directory. Vendoring allows us to lock our dependencies and to modify them easily from the top level Cargo.toml. We vendor all dependencies, including the crates.io ones, which allows for network isolated builds. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
48 lines
1.2 KiB
Rust
48 lines
1.2 KiB
Rust
//! SGX C types definition
|
|
|
|
pub type c_schar = i8;
|
|
pub type c_uchar = u8;
|
|
pub type c_short = i16;
|
|
pub type c_ushort = u16;
|
|
pub type c_int = i32;
|
|
pub type c_uint = u32;
|
|
pub type c_float = f32;
|
|
pub type c_double = f64;
|
|
pub type c_longlong = i64;
|
|
pub type c_ulonglong = u64;
|
|
pub type intmax_t = i64;
|
|
pub type uintmax_t = u64;
|
|
|
|
pub type size_t = usize;
|
|
pub type ptrdiff_t = isize;
|
|
pub type intptr_t = isize;
|
|
pub type uintptr_t = usize;
|
|
pub type ssize_t = isize;
|
|
|
|
pub type c_char = i8;
|
|
pub type c_long = i64;
|
|
pub type c_ulong = u64;
|
|
|
|
pub const INT_MIN: c_int = -2147483648;
|
|
pub const INT_MAX: c_int = 2147483647;
|
|
|
|
cfg_if! {
|
|
if #[cfg(libc_core_cvoid)] {
|
|
pub use ::ffi::c_void;
|
|
} else {
|
|
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
|
|
// enable more optimization opportunities around it recognizing things
|
|
// like malloc/free.
|
|
#[repr(u8)]
|
|
#[allow(missing_copy_implementations)]
|
|
#[allow(missing_debug_implementations)]
|
|
pub enum c_void {
|
|
// Two dummy variants so the #[repr] attribute can be used.
|
|
#[doc(hidden)]
|
|
__variant1,
|
|
#[doc(hidden)]
|
|
__variant2,
|
|
}
|
|
}
|
|
}
|