|
| 1 | +/* automatically generated by rust-bindgen */ |
| 2 | + |
| 3 | + |
| 4 | +#![allow(non_snake_case)] |
| 5 | + |
| 6 | + |
| 7 | +#[derive(Copy, Debug)] |
| 8 | +#[repr(C)] |
| 9 | +pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); |
| 10 | +impl <T> __BindgenUnionField<T> { |
| 11 | + #[inline] |
| 12 | + pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } |
| 13 | + #[inline] |
| 14 | + pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } |
| 15 | + #[inline] |
| 16 | + pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } |
| 17 | +} |
| 18 | +impl <T> ::std::default::Default for __BindgenUnionField<T> { |
| 19 | + #[inline] |
| 20 | + fn default() -> Self { Self::new() } |
| 21 | +} |
| 22 | +impl <T> ::std::clone::Clone for __BindgenUnionField<T> { |
| 23 | + #[inline] |
| 24 | + fn clone(&self) -> Self { Self::new() } |
| 25 | +} |
| 26 | +#[repr(C)] |
| 27 | +#[derive(Debug)] |
| 28 | +pub struct Union_UnionWithDtor { |
| 29 | + pub mFoo: __BindgenUnionField<::std::os::raw::c_int>, |
| 30 | + pub mBar: __BindgenUnionField<*mut ::std::os::raw::c_void>, |
| 31 | + pub _bindgen_data_: u64, |
| 32 | +} |
| 33 | +impl Union_UnionWithDtor { |
| 34 | + pub unsafe fn mFoo(&mut self) -> *mut ::std::os::raw::c_int { |
| 35 | + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); |
| 36 | + ::std::mem::transmute(raw.offset(0)) |
| 37 | + } |
| 38 | + pub unsafe fn mBar(&mut self) -> *mut *mut ::std::os::raw::c_void { |
| 39 | + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); |
| 40 | + ::std::mem::transmute(raw.offset(0)) |
| 41 | + } |
| 42 | +} |
| 43 | +#[test] |
| 44 | +fn bindgen_test_layout_Union_UnionWithDtor() { |
| 45 | + assert_eq!(::std::mem::size_of::<Union_UnionWithDtor>() , 8usize); |
| 46 | + assert_eq!(::std::mem::align_of::<Union_UnionWithDtor>() , 8usize); |
| 47 | +} |
0 commit comments