Adjusted project data.
Properly pointed to the repository location. Changed the rust edition.
This commit is contained in:
@ -3,54 +3,10 @@
|
||||
|
||||
//! This defines the primitive types that may be seen
|
||||
//! when creating 'C' bindings.
|
||||
//!
|
||||
//! There are several places where the target architecture and the OS
|
||||
//! require special consideration. These are handled
|
||||
//! with configuration statements.
|
||||
|
||||
// Character types.
|
||||
#[cfg(any(target_os="android", target_os="emscripten",
|
||||
all(target_os="linux",
|
||||
any(target_arch="aarch64", target_arch="arm",
|
||||
target_arch="powerpc", target_arch="powerpc64"))))]
|
||||
pub type CChar = u8;
|
||||
|
||||
#[cfg(not(any(target_os="android", target_os="emscripten",
|
||||
all(target_os="linux",
|
||||
any(target_arch="aarch64", target_arch="arm",
|
||||
target_arch="powerpc", target_arch="powerpc64")))))]
|
||||
pub type CChar = i8;
|
||||
|
||||
|
||||
pub type CUChar = u8;
|
||||
|
||||
|
||||
|
||||
// Integer types.
|
||||
#[cfg(any(target_pointer_width="32", target_os="windows"))]
|
||||
pub type CLong = i32;
|
||||
|
||||
#[cfg(any(target_pointer_width="32", target_os="windows"))]
|
||||
pub type CULong = u32;
|
||||
|
||||
|
||||
#[cfg(all(target_pointer_width="64", not(target_os="windows")))]
|
||||
pub type CLong = i32;
|
||||
|
||||
#[cfg(all(target_pointer_width="64", not(target_os="windows")))]
|
||||
pub type CULong = u32;
|
||||
|
||||
|
||||
pub type CShort = i16;
|
||||
pub type CUShort = u16;
|
||||
pub type CInt = i32;
|
||||
pub type CUInt = u32;
|
||||
pub type CLongLong = i64;
|
||||
pub type CULongLong = u64;
|
||||
pub type CFloat = f32;
|
||||
pub type CDouble = f64;
|
||||
|
||||
|
||||
/// CVoid acts as a 'C' void pointer to pass to functions. **DO NOT**
|
||||
/// use this as a return type from a 'C' function. If a 'C' function
|
||||
/// returns void, then use the CReturnVoid type for that.
|
||||
pub use std::ffi::{c_char as CChar, c_double as CDouble, c_float as CFloat, c_int as CInt, c_long as CLong, c_longlong as CLongLong, c_short as CShort, c_uchar as CUChar, c_uint as CUInt, c_ulong as CULong, c_ulonglong as CULongLong, c_ushort as CUShort, c_void as CVoid, CStr};
|
||||
|
||||
// Void types.
|
||||
/// To return void from a 'C' function it should return an empty tuple ().
|
||||
@ -58,38 +14,5 @@ pub type CDouble = f64;
|
||||
/// as an argument to a function. Use the CVoid type for that.
|
||||
pub type CReturnVoid = ();
|
||||
|
||||
/// This acts as a 'C' void pointer to pass to functions. **DO NOT**
|
||||
/// use this as a return type from a 'C' function. If a 'C' function
|
||||
/// returns void, then use the CReturnVoid type for that.
|
||||
#[repr(u8)]
|
||||
pub enum CVoid
|
||||
{
|
||||
#[doc(hidden)]
|
||||
_Variant,
|
||||
|
||||
#[doc(hidden)]
|
||||
_Variant2
|
||||
}
|
||||
|
||||
|
||||
|
||||
// String types.
|
||||
/*
|
||||
#[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone)]
|
||||
pub struct CString
|
||||
{
|
||||
chars: Box<[u8]>
|
||||
}
|
||||
|
||||
#[derive(Hash)]
|
||||
pub struct CStr
|
||||
{
|
||||
inner: [CChar]
|
||||
}
|
||||
*/
|
||||
#[cfg(feature="use_std")]
|
||||
pub type CStr = ::std::ffi::CStr;
|
||||
#[cfg(feature="use_std")]
|
||||
#[cfg(feature = "use_std")]
|
||||
pub type CString = ::std::ffi::CString;
|
||||
#[cfg(feature="use_std")]
|
||||
pub type NullByteError = ::std::ffi::NulError;
|
||||
|
Reference in New Issue
Block a user