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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Copy)]
pub struct Struct_C {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
}
impl ::std::clone::Clone for Struct_C {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_C() {
assert_eq!(::std::mem::size_of::<Struct_C>() , 40usize);
assert_eq!(::std::mem::align_of::<Struct_C>() , 4usize);
}
#[repr(C)]
#[derive(Debug)]
pub struct Struct_WithDtor {
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Struct_WithDtor() {
assert_eq!(::std::mem::size_of::<Struct_WithDtor>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_WithDtor>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_Union {
pub d: __BindgenUnionField<f32>,
pub i: __BindgenUnionField<::std::os::raw::c_int>,
pub _bindgen_data_: u32,
}
impl Union_Union {
pub unsafe fn d(&mut self) -> *mut f32 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn i(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_Union {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_Union() {
assert_eq!(::std::mem::size_of::<Union_Union>() , 4usize);
assert_eq!(::std::mem::align_of::<Union_Union>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_WithUnion {
pub data: Union_Union,
}
impl ::std::clone::Clone for Struct_WithUnion {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_WithUnion() {
assert_eq!(::std::mem::size_of::<Struct_WithUnion>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_WithUnion>() , 4usize);
}
|