1 #![allow( 2 dead_code, 3 non_snake_case, 4 non_camel_case_types, 5 non_upper_case_globals 6 )] 7 8 #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] 9 pub mod root { 10 #[allow(unused_imports)] 11 use self::super::root; 12 extern "C" { 13 #[link_name = "\u{1}_Z9top_levelv"] top_level()14 pub fn top_level(); 15 } 16 pub mod whatever { 17 #[allow(unused_imports)] 18 use self::super::super::root; 19 pub type whatever_other_thing_t = whatever_int_t; 20 pub type whatever_int_t = ::std::os::raw::c_int; 21 extern "C" { 22 #[link_name = "\u{1}_ZN8whatever11in_whateverEv"] in_whatever()23 pub fn in_whatever(); 24 } 25 } 26 pub mod _bindgen_mod_id_17 { 27 #[allow(unused_imports)] 28 use self::super::super::root; 29 #[repr(C)] 30 #[derive(Debug, Default, Copy, Clone)] 31 pub struct A { 32 pub b: root::whatever::whatever_int_t, 33 } 34 #[test] bindgen_test_layout_A()35 fn bindgen_test_layout_A() { 36 const UNINIT: ::std::mem::MaybeUninit<A> = 37 ::std::mem::MaybeUninit::uninit(); 38 let ptr = UNINIT.as_ptr(); 39 assert_eq!( 40 ::std::mem::size_of::<A>(), 41 4usize, 42 concat!("Size of: ", stringify!(A)) 43 ); 44 assert_eq!( 45 ::std::mem::align_of::<A>(), 46 4usize, 47 concat!("Alignment of ", stringify!(A)) 48 ); 49 assert_eq!( 50 unsafe { 51 ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize 52 }, 53 0usize, 54 concat!( 55 "Offset of field: ", 56 stringify!(A), 57 "::", 58 stringify!(b) 59 ) 60 ); 61 } 62 } 63 #[repr(C)] 64 #[derive(Debug)] 65 pub struct C<T> { 66 pub _base: root::_bindgen_mod_id_17::A, 67 pub m_c: T, 68 pub m_c_ptr: *mut T, 69 pub m_c_arr: [T; 10usize], 70 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, 71 } 72 impl<T> Default for C<T> { default() -> Self73 fn default() -> Self { 74 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 75 unsafe { 76 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 77 s.assume_init() 78 } 79 } 80 } 81 pub mod w { 82 #[allow(unused_imports)] 83 use self::super::super::root; 84 pub type whatever_int_t = ::std::os::raw::c_uint; 85 #[repr(C)] 86 #[derive(Debug)] 87 pub struct D<T> { 88 pub m_c: root::C<T>, 89 pub _phantom_0: 90 ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, 91 } 92 impl<T> Default for D<T> { default() -> Self93 fn default() -> Self { 94 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 95 unsafe { 96 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 97 s.assume_init() 98 } 99 } 100 } 101 extern "C" { 102 #[link_name = "\u{1}_ZN1w3hehEv"] heh() -> root::w::whatever_int_t103 pub fn heh() -> root::w::whatever_int_t; 104 } 105 extern "C" { 106 #[link_name = "\u{1}_ZN1w3fooEv"] foo() -> root::C<::std::os::raw::c_int>107 pub fn foo() -> root::C<::std::os::raw::c_int>; 108 } 109 extern "C" { 110 #[link_name = "\u{1}_ZN1w4barrEv"] barr() -> root::C<f32>111 pub fn barr() -> root::C<f32>; 112 } 113 } 114 pub mod foobar { 115 #[allow(unused_imports)] 116 use self::super::super::root; 117 extern "C" { 118 #[link_name = "\u{1}_ZN6foobar3fooEv"] foo()119 pub fn foo(); 120 } 121 } 122 pub mod faraway { 123 #[allow(unused_imports)] 124 use self::super::super::root; 125 extern "C" { 126 #[link_name = "\u{1}_ZN7faraway3barEv"] bar()127 pub fn bar(); 128 } 129 } 130 } 131