• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![allow(
2     dead_code,
3     non_snake_case,
4     non_camel_case_types,
5     non_upper_case_globals
6 )]
7 
8 #[repr(C)]
9 pub struct Base__bindgen_vtable {
10     pub Base_AsDerived: unsafe extern "C" fn(this: *mut Base) -> *mut Derived,
11 }
12 #[repr(C)]
13 #[derive(Debug, Copy, Clone)]
14 pub struct Base {
15     pub vtable_: *const Base__bindgen_vtable,
16 }
17 #[test]
bindgen_test_layout_Base()18 fn bindgen_test_layout_Base() {
19     assert_eq!(
20         ::std::mem::size_of::<Base>(),
21         8usize,
22         concat!("Size of: ", stringify!(Base))
23     );
24     assert_eq!(
25         ::std::mem::align_of::<Base>(),
26         8usize,
27         concat!("Alignment of ", stringify!(Base))
28     );
29 }
30 impl Default for Base {
default() -> Self31     fn default() -> Self {
32         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
33         unsafe {
34             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
35             s.assume_init()
36         }
37     }
38 }
39 extern "C" {
40     #[link_name = "\u{1}_ZN4Base9AsDerivedEv"]
Base_AsDerived(this: *mut ::std::os::raw::c_void) -> *mut Derived41     pub fn Base_AsDerived(this: *mut ::std::os::raw::c_void) -> *mut Derived;
42 }
43 #[repr(C)]
44 #[derive(Debug, Copy, Clone)]
45 pub struct Derived {
46     pub _base: Base,
47 }
48 #[test]
bindgen_test_layout_Derived()49 fn bindgen_test_layout_Derived() {
50     assert_eq!(
51         ::std::mem::size_of::<Derived>(),
52         8usize,
53         concat!("Size of: ", stringify!(Derived))
54     );
55     assert_eq!(
56         ::std::mem::align_of::<Derived>(),
57         8usize,
58         concat!("Alignment of ", stringify!(Derived))
59     );
60 }
61 impl Default for Derived {
default() -> Self62     fn default() -> Self {
63         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
64         unsafe {
65             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
66             s.assume_init()
67         }
68     }
69 }
70