1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#![allow(non_camel_case_types)]
use core::fmt;
pub type c_int = i32;
pub type c_uchar = u8;
pub type c_uint = u32;
pub type c_char = i8;
#[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")
}
}
#[cfg(test)]
mod tests {
use std::os::raw;
use std::any::TypeId;
use types;
#[test]
fn verify_types() {
assert_eq!(TypeId::of::<types::c_int>(), TypeId::of::<raw::c_int>());
assert_eq!(TypeId::of::<types::c_uchar>(), TypeId::of::<raw::c_uchar>());
assert_eq!(TypeId::of::<types::c_uint>(), TypeId::of::<raw::c_uint>());
assert_eq!(TypeId::of::<types::c_char>(), TypeId::of::<raw::c_char>());
}
}