|
| 1 | +/* automatically generated by rust-bindgen */ |
| 2 | + |
| 3 | +#![allow( |
| 4 | + dead_code, |
| 5 | + non_snake_case, |
| 6 | + non_camel_case_types, |
| 7 | + non_upper_case_globals |
| 8 | +)] |
| 9 | + |
| 10 | +#[repr(C)] |
| 11 | +#[derive(Default)] |
| 12 | +pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]); |
| 13 | +impl<T> __IncompleteArrayField<T> { |
| 14 | + #[inline] |
| 15 | + pub fn new() -> Self { |
| 16 | + __IncompleteArrayField(::std::marker::PhantomData, []) |
| 17 | + } |
| 18 | + #[inline] |
| 19 | + pub unsafe fn as_ptr(&self) -> *const T { |
| 20 | + ::std::mem::transmute(self) |
| 21 | + } |
| 22 | + #[inline] |
| 23 | + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { |
| 24 | + ::std::mem::transmute(self) |
| 25 | + } |
| 26 | + #[inline] |
| 27 | + pub unsafe fn as_slice(&self, len: usize) -> &[T] { |
| 28 | + ::std::slice::from_raw_parts(self.as_ptr(), len) |
| 29 | + } |
| 30 | + #[inline] |
| 31 | + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { |
| 32 | + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) |
| 33 | + } |
| 34 | +} |
| 35 | +impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> { |
| 36 | + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
| 37 | + fmt.write_str("__IncompleteArrayField") |
| 38 | + } |
| 39 | +} |
| 40 | +impl<T> ::std::clone::Clone for __IncompleteArrayField<T> { |
| 41 | + #[inline] |
| 42 | + fn clone(&self) -> Self { |
| 43 | + Self::new() |
| 44 | + } |
| 45 | +} |
| 46 | +#[repr(C)] |
| 47 | +#[derive(Debug, Default)] |
| 48 | +pub struct dm_deps { |
| 49 | + pub count: ::std::os::raw::c_uint, |
| 50 | + pub filler: ::std::os::raw::c_uint, |
| 51 | + pub device: __IncompleteArrayField<::std::os::raw::c_ulonglong>, |
| 52 | +} |
| 53 | +#[test] |
| 54 | +fn bindgen_test_layout_dm_deps() { |
| 55 | + assert_eq!( |
| 56 | + ::std::mem::size_of::<dm_deps>(), |
| 57 | + 8usize, |
| 58 | + concat!("Size of: ", stringify!(dm_deps)) |
| 59 | + ); |
| 60 | + assert_eq!( |
| 61 | + ::std::mem::align_of::<dm_deps>(), |
| 62 | + 8usize, |
| 63 | + concat!("Alignment of ", stringify!(dm_deps)) |
| 64 | + ); |
| 65 | + assert_eq!( |
| 66 | + unsafe { &(*(::std::ptr::null::<dm_deps>())).count as *const _ as usize }, |
| 67 | + 0usize, |
| 68 | + concat!( |
| 69 | + "Offset of field: ", |
| 70 | + stringify!(dm_deps), |
| 71 | + "::", |
| 72 | + stringify!(count) |
| 73 | + ) |
| 74 | + ); |
| 75 | + assert_eq!( |
| 76 | + unsafe { &(*(::std::ptr::null::<dm_deps>())).filler as *const _ as usize }, |
| 77 | + 4usize, |
| 78 | + concat!( |
| 79 | + "Offset of field: ", |
| 80 | + stringify!(dm_deps), |
| 81 | + "::", |
| 82 | + stringify!(filler) |
| 83 | + ) |
| 84 | + ); |
| 85 | + assert_eq!( |
| 86 | + unsafe { &(*(::std::ptr::null::<dm_deps>())).device as *const _ as usize }, |
| 87 | + 8usize, |
| 88 | + concat!( |
| 89 | + "Offset of field: ", |
| 90 | + stringify!(dm_deps), |
| 91 | + "::", |
| 92 | + stringify!(device) |
| 93 | + ) |
| 94 | + ); |
| 95 | +} |
0 commit comments