From f2975e2793ec657cacc9fc8129cf24f7ea35b10c Mon Sep 17 00:00:00 2001 From: Ola x Nilsson Date: Fri, 17 Mar 2023 15:21:05 +0100 Subject: [PATCH] linux: Use the input_event_X macros to access input_event members This means the same members are available in the struct no matter whether it is a 32 or 64 bit platform or the linux_time_bits64 config is set. --- src/unix/linux_like/linux/mod.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 3f481fb755c8d..892562bef6622 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -332,21 +332,18 @@ s! { } pub struct input_event { - // FIXME(1.0): Change to the commented variant, see https://github.com/rust-lang/libc/pull/4148#discussion_r1857511742 #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))] - pub time: crate::timeval, - // #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))] - // pub input_event_sec: time_t, - // #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))] - // pub input_event_usec: suseconds_t, - // #[cfg(target_arch = "sparc64")] - // _pad1: c_int, + pub input_event_sec: crate::time_t, #[cfg(all(target_pointer_width = "32", linux_time_bits64))] pub input_event_sec: c_ulong, + #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))] + pub input_event_usec: crate::suseconds_t, #[cfg(all(target_pointer_width = "32", linux_time_bits64))] pub input_event_usec: c_ulong, + #[cfg(target_arch = "sparc64")] + _pad1: c_int, pub type_: __u16, pub code: __u16, pub value: __s32,