2019-02-18 12:31:30 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
2019-02-18 14:47:11 +00:00
|
|
|
use core::fmt;
|
|
|
|
|
2019-02-18 12:31:30 +00:00
|
|
|
pub type c_int = i32;
|
|
|
|
pub type c_uchar = u8;
|
|
|
|
pub type c_uint = u32;
|
2019-06-12 14:38:30 +00:00
|
|
|
|
|
|
|
/// This might not match C's `c_char` exactly.
|
|
|
|
/// The way we use it makes it fine either way but this type shouldn't be used outside of the library.
|
2019-05-28 13:31:01 +00:00
|
|
|
pub type c_char = i8;
|
2019-02-18 14:47:11 +00:00
|
|
|
|
|
|
|
/// This is an exact copy of https://doc.rust-lang.org/core/ffi/enum.c_void.html
|
|
|
|
/// It should be Equivalent to C's void type when used as a pointer.
|
|
|
|
///
|
|
|
|
/// We can replace this with `core::ffi::c_void` once we update the rustc version to >=1.30.0.
|
|
|
|
#[repr(u8)]
|
|
|
|
pub enum c_void {
|
|
|
|
#[doc(hidden)] __variant1,
|
|
|
|
#[doc(hidden)] __variant2,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Debug for c_void {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
f.pad("c_void")
|
|
|
|
}
|
|
|
|
}
|