sdl3/
macros.rs

1macro_rules! impl_raw_accessors(
2    ($(($t:ty, $raw:ty)),+) => (
3        $(
4        impl $t {
5            #[inline]
6            // can prevent introducing UB until
7            // https://github.com/rust-lang/rust-clippy/issues/5953 is fixed
8            #[allow(clippy::trivially_copy_pass_by_ref)]
9            pub const unsafe fn raw(&self) -> $raw { self.raw }
10        }
11        )+
12    )
13);
14
15macro_rules! impl_raw_constructor(
16    ($(($t:ty, $te:ident ($($r:ident:$rt:ty),+))),+) => (
17        $(
18        impl $t {
19            #[inline]
20            pub const unsafe fn from_ll($($r:$rt),+) -> $t {
21                $te { $($r: $r),+ }
22            }
23        }
24        )+
25    )
26);