|
| 1 | +/* automatically generated by rust-bindgen */ |
| 2 | + |
| 3 | + |
| 4 | +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] |
| 5 | + |
| 6 | + |
| 7 | +#[repr(C)] |
| 8 | +#[derive(Copy, Clone)] |
| 9 | +pub struct perf_event_attr { |
| 10 | + pub type_: ::std::os::raw::c_uint, |
| 11 | + pub a: f32, |
| 12 | + pub __bindgen_anon_1: perf_event_attr__bindgen_ty_1, |
| 13 | +} |
| 14 | +#[repr(C)] |
| 15 | +#[derive(Copy, Clone)] |
| 16 | +pub union perf_event_attr__bindgen_ty_1 { |
| 17 | + pub b: ::std::os::raw::c_int, |
| 18 | + pub c: ::std::os::raw::c_int, |
| 19 | + _bindgen_union_align: u32, |
| 20 | +} |
| 21 | +#[test] |
| 22 | +fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { |
| 23 | + assert_eq!( |
| 24 | + ::std::mem::size_of::<perf_event_attr__bindgen_ty_1>(), |
| 25 | + 4usize, |
| 26 | + concat!("Size of: ", stringify!(perf_event_attr__bindgen_ty_1)) |
| 27 | + ); |
| 28 | + assert_eq!( |
| 29 | + ::std::mem::align_of::<perf_event_attr__bindgen_ty_1>(), |
| 30 | + 4usize, |
| 31 | + concat!("Alignment of ", stringify!(perf_event_attr__bindgen_ty_1)) |
| 32 | + ); |
| 33 | + assert_eq!( |
| 34 | + unsafe { &(*(0 as *const perf_event_attr__bindgen_ty_1)).b as *const _ as usize }, |
| 35 | + 0usize, |
| 36 | + concat!( |
| 37 | + "Alignment of field: ", |
| 38 | + stringify!(perf_event_attr__bindgen_ty_1), |
| 39 | + "::", |
| 40 | + stringify!(b) |
| 41 | + ) |
| 42 | + ); |
| 43 | + assert_eq!( |
| 44 | + unsafe { &(*(0 as *const perf_event_attr__bindgen_ty_1)).c as *const _ as usize }, |
| 45 | + 0usize, |
| 46 | + concat!( |
| 47 | + "Alignment of field: ", |
| 48 | + stringify!(perf_event_attr__bindgen_ty_1), |
| 49 | + "::", |
| 50 | + stringify!(c) |
| 51 | + ) |
| 52 | + ); |
| 53 | +} |
| 54 | +impl Default for perf_event_attr__bindgen_ty_1 { |
| 55 | + fn default() -> Self { |
| 56 | + unsafe { ::std::mem::zeroed() } |
| 57 | + } |
| 58 | +} |
| 59 | +impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_1 { |
| 60 | + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { |
| 61 | + write!(f, "perf_event_attr__bindgen_ty_1 {{ union }}") |
| 62 | + } |
| 63 | +} |
| 64 | +#[test] |
| 65 | +fn bindgen_test_layout_perf_event_attr() { |
| 66 | + assert_eq!( |
| 67 | + ::std::mem::size_of::<perf_event_attr>(), |
| 68 | + 12usize, |
| 69 | + concat!("Size of: ", stringify!(perf_event_attr)) |
| 70 | + ); |
| 71 | + assert_eq!( |
| 72 | + ::std::mem::align_of::<perf_event_attr>(), |
| 73 | + 4usize, |
| 74 | + concat!("Alignment of ", stringify!(perf_event_attr)) |
| 75 | + ); |
| 76 | + assert_eq!( |
| 77 | + unsafe { &(*(0 as *const perf_event_attr)).type_ as *const _ as usize }, |
| 78 | + 0usize, |
| 79 | + concat!( |
| 80 | + "Alignment of field: ", |
| 81 | + stringify!(perf_event_attr), |
| 82 | + "::", |
| 83 | + stringify!(type_) |
| 84 | + ) |
| 85 | + ); |
| 86 | + assert_eq!( |
| 87 | + unsafe { &(*(0 as *const perf_event_attr)).a as *const _ as usize }, |
| 88 | + 4usize, |
| 89 | + concat!( |
| 90 | + "Alignment of field: ", |
| 91 | + stringify!(perf_event_attr), |
| 92 | + "::", |
| 93 | + stringify!(a) |
| 94 | + ) |
| 95 | + ); |
| 96 | +} |
| 97 | +impl Default for perf_event_attr { |
| 98 | + fn default() -> Self { |
| 99 | + unsafe { ::std::mem::zeroed() } |
| 100 | + } |
| 101 | +} |
| 102 | +impl ::std::fmt::Debug for perf_event_attr { |
| 103 | + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { |
| 104 | + write!( |
| 105 | + f, |
| 106 | + "perf_event_attr {{ type: {:?}, a: {:?}, __bindgen_anon_1: {:?} }}", |
| 107 | + self.type_, |
| 108 | + self.a, |
| 109 | + self.__bindgen_anon_1 |
| 110 | + ) |
| 111 | + } |
| 112 | +} |
0 commit comments