blob: 04883f789abf4818ce70bc8da0c28e9c6eb56149 (
plain)
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
|
/* 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(Debug, Copy)]
pub struct Struct_foo {
pub bar: Union_foo_struct_with_anon_union_h_unnamed_1,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_struct_with_anon_union_h_unnamed_1 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub _bindgen_data_: u32,
}
impl Union_foo_struct_with_anon_union_h_unnamed_1 {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo_struct_with_anon_union_h_unnamed_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_struct_with_anon_union_h_unnamed_1() {
assert_eq!(::std::mem::size_of::<Union_foo_struct_with_anon_union_h_unnamed_1>()
, 4usize);
assert_eq!(::std::mem::align_of::<Union_foo_struct_with_anon_union_h_unnamed_1>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
|