|
| 1 | +/* automatically generated by rust-bindgen */ |
| 2 | + |
| 3 | + |
| 4 | +#![allow(non_snake_case)] |
| 5 | + |
| 6 | + |
| 7 | +pub type my_fun_t = |
| 8 | + ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int, |
| 9 | + arg2: ::std::os::raw::c_int, |
| 10 | + arg3: ::std::os::raw::c_int, |
| 11 | + arg4: ::std::os::raw::c_int, |
| 12 | + arg5: ::std::os::raw::c_int, |
| 13 | + arg6: ::std::os::raw::c_int, |
| 14 | + arg7: ::std::os::raw::c_int, |
| 15 | + arg8: ::std::os::raw::c_int, |
| 16 | + arg9: ::std::os::raw::c_int, |
| 17 | + arg10: ::std::os::raw::c_int, |
| 18 | + arg11: ::std::os::raw::c_int, |
| 19 | + arg12: ::std::os::raw::c_int, |
| 20 | + arg13: ::std::os::raw::c_int, |
| 21 | + arg14: ::std::os::raw::c_int, |
| 22 | + arg15: ::std::os::raw::c_int, |
| 23 | + arg16: ::std::os::raw::c_int)>; |
| 24 | +#[repr(C)] |
| 25 | +#[derive(Copy)] |
| 26 | +pub struct Foo { |
| 27 | + pub callback: my_fun_t, |
| 28 | +} |
| 29 | +#[test] |
| 30 | +fn bindgen_test_layout_Foo() { |
| 31 | + assert_eq!(::std::mem::size_of::<Foo>() , 8usize , concat ! ( |
| 32 | + "Size of: " , stringify ! ( Foo ) )); |
| 33 | + assert_eq! (::std::mem::align_of::<Foo>() , 8usize , concat ! ( |
| 34 | + "Alignment of " , stringify ! ( Foo ) )); |
| 35 | + assert_eq! (unsafe { |
| 36 | + & ( * ( 0 as * const Foo ) ) . callback as * const _ as usize |
| 37 | + } , 0usize , concat ! ( |
| 38 | + "Alignment of field: " , stringify ! ( Foo ) , "::" , |
| 39 | + stringify ! ( callback ) )); |
| 40 | +} |
| 41 | +impl Clone for Foo { |
| 42 | + fn clone(&self) -> Self { *self } |
| 43 | +} |
| 44 | +impl Default for Foo { |
| 45 | + fn default() -> Self { unsafe { ::std::mem::zeroed() } } |
| 46 | +} |
0 commit comments