• 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 #[derive(Debug, Copy, Clone)]
10 pub struct foo {
11     pub member: foo__bindgen_ty_1,
12 }
13 pub const foo_FOO_A: foo__bindgen_ty_1 = foo__bindgen_ty_1(0);
14 pub const foo_FOO_B: foo__bindgen_ty_1 = foo__bindgen_ty_1(1);
15 impl ::std::ops::BitOr<foo__bindgen_ty_1> for foo__bindgen_ty_1 {
16     type Output = Self;
17     #[inline]
bitor(self, other: Self) -> Self18     fn bitor(self, other: Self) -> Self {
19         foo__bindgen_ty_1(self.0 | other.0)
20     }
21 }
22 impl ::std::ops::BitOrAssign for foo__bindgen_ty_1 {
23     #[inline]
bitor_assign(&mut self, rhs: foo__bindgen_ty_1)24     fn bitor_assign(&mut self, rhs: foo__bindgen_ty_1) {
25         self.0 |= rhs.0;
26     }
27 }
28 impl ::std::ops::BitAnd<foo__bindgen_ty_1> for foo__bindgen_ty_1 {
29     type Output = Self;
30     #[inline]
bitand(self, other: Self) -> Self31     fn bitand(self, other: Self) -> Self {
32         foo__bindgen_ty_1(self.0 & other.0)
33     }
34 }
35 impl ::std::ops::BitAndAssign for foo__bindgen_ty_1 {
36     #[inline]
bitand_assign(&mut self, rhs: foo__bindgen_ty_1)37     fn bitand_assign(&mut self, rhs: foo__bindgen_ty_1) {
38         self.0 &= rhs.0;
39     }
40 }
41 #[repr(transparent)]
42 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
43 pub struct foo__bindgen_ty_1(pub ::std::os::raw::c_uint);
44 #[test]
bindgen_test_layout_foo()45 fn bindgen_test_layout_foo() {
46     const UNINIT: ::std::mem::MaybeUninit<foo> =
47         ::std::mem::MaybeUninit::uninit();
48     let ptr = UNINIT.as_ptr();
49     assert_eq!(
50         ::std::mem::size_of::<foo>(),
51         4usize,
52         concat!("Size of: ", stringify!(foo))
53     );
54     assert_eq!(
55         ::std::mem::align_of::<foo>(),
56         4usize,
57         concat!("Alignment of ", stringify!(foo))
58     );
59     assert_eq!(
60         unsafe { ::std::ptr::addr_of!((*ptr).member) as usize - ptr as usize },
61         0usize,
62         concat!(
63             "Offset of field: ",
64             stringify!(foo),
65             "::",
66             stringify!(member)
67         )
68     );
69 }
70 impl Default for foo {
default() -> Self71     fn default() -> Self {
72         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
73         unsafe {
74             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
75             s.assume_init()
76         }
77     }
78 }
79 impl Foo {
80     pub const Bar: Foo = Foo(0);
81 }
82 impl Foo {
83     pub const Qux: Foo = Foo(1);
84 }
85 impl ::std::ops::BitOr<Foo> for Foo {
86     type Output = Self;
87     #[inline]
bitor(self, other: Self) -> Self88     fn bitor(self, other: Self) -> Self {
89         Foo(self.0 | other.0)
90     }
91 }
92 impl ::std::ops::BitOrAssign for Foo {
93     #[inline]
bitor_assign(&mut self, rhs: Foo)94     fn bitor_assign(&mut self, rhs: Foo) {
95         self.0 |= rhs.0;
96     }
97 }
98 impl ::std::ops::BitAnd<Foo> for Foo {
99     type Output = Self;
100     #[inline]
bitand(self, other: Self) -> Self101     fn bitand(self, other: Self) -> Self {
102         Foo(self.0 & other.0)
103     }
104 }
105 impl ::std::ops::BitAndAssign for Foo {
106     #[inline]
bitand_assign(&mut self, rhs: Foo)107     fn bitand_assign(&mut self, rhs: Foo) {
108         self.0 &= rhs.0;
109     }
110 }
111 #[repr(transparent)]
112 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
113 pub struct Foo(pub ::std::os::raw::c_uint);
114 pub mod Neg {
115     pub type Type = ::std::os::raw::c_int;
116     pub const MinusOne: Type = -1;
117     pub const One: Type = 1;
118 }
119 impl NoDebug {
120     pub const NoDebug1: NoDebug = NoDebug(0);
121 }
122 impl NoDebug {
123     pub const NoDebug2: NoDebug = NoDebug(1);
124 }
125 impl ::std::ops::BitOr<NoDebug> for NoDebug {
126     type Output = Self;
127     #[inline]
bitor(self, other: Self) -> Self128     fn bitor(self, other: Self) -> Self {
129         NoDebug(self.0 | other.0)
130     }
131 }
132 impl ::std::ops::BitOrAssign for NoDebug {
133     #[inline]
bitor_assign(&mut self, rhs: NoDebug)134     fn bitor_assign(&mut self, rhs: NoDebug) {
135         self.0 |= rhs.0;
136     }
137 }
138 impl ::std::ops::BitAnd<NoDebug> for NoDebug {
139     type Output = Self;
140     #[inline]
bitand(self, other: Self) -> Self141     fn bitand(self, other: Self) -> Self {
142         NoDebug(self.0 & other.0)
143     }
144 }
145 impl ::std::ops::BitAndAssign for NoDebug {
146     #[inline]
bitand_assign(&mut self, rhs: NoDebug)147     fn bitand_assign(&mut self, rhs: NoDebug) {
148         self.0 &= rhs.0;
149     }
150 }
151 #[repr(transparent)]
152 /// <div rustbindgen nodebug></div>
153 #[derive(Copy, Clone, Hash, PartialEq, Eq)]
154 pub struct NoDebug(pub ::std::os::raw::c_uint);
155 impl Debug {
156     pub const Debug1: Debug = Debug(0);
157 }
158 impl Debug {
159     pub const Debug2: Debug = Debug(1);
160 }
161 impl ::std::ops::BitOr<Debug> for Debug {
162     type Output = Self;
163     #[inline]
bitor(self, other: Self) -> Self164     fn bitor(self, other: Self) -> Self {
165         Debug(self.0 | other.0)
166     }
167 }
168 impl ::std::ops::BitOrAssign for Debug {
169     #[inline]
bitor_assign(&mut self, rhs: Debug)170     fn bitor_assign(&mut self, rhs: Debug) {
171         self.0 |= rhs.0;
172     }
173 }
174 impl ::std::ops::BitAnd<Debug> for Debug {
175     type Output = Self;
176     #[inline]
bitand(self, other: Self) -> Self177     fn bitand(self, other: Self) -> Self {
178         Debug(self.0 & other.0)
179     }
180 }
181 impl ::std::ops::BitAndAssign for Debug {
182     #[inline]
bitand_assign(&mut self, rhs: Debug)183     fn bitand_assign(&mut self, rhs: Debug) {
184         self.0 &= rhs.0;
185     }
186 }
187 #[repr(transparent)]
188 /// <div rustbindgen derive="Debug"></div>
189 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
190 pub struct Debug(pub ::std::os::raw::c_uint);
191