Skip to content

Commit f2975e2

Browse files
committed
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.
1 parent 1e8377c commit f2975e2

File tree

1 file changed

+5
-8
lines changed
  • src/unix/linux_like/linux

1 file changed

+5
-8
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,21 +332,18 @@ s! {
332332
}
333333

334334
pub struct input_event {
335-
// FIXME(1.0): Change to the commented variant, see https://github.com/rust-lang/libc/pull/4148#discussion_r1857511742
336335
#[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))]
337-
pub time: crate::timeval,
338-
// #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))]
339-
// pub input_event_sec: time_t,
340-
// #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))]
341-
// pub input_event_usec: suseconds_t,
342-
// #[cfg(target_arch = "sparc64")]
343-
// _pad1: c_int,
336+
pub input_event_sec: crate::time_t,
344337
#[cfg(all(target_pointer_width = "32", linux_time_bits64))]
345338
pub input_event_sec: c_ulong,
346339

340+
#[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))]
341+
pub input_event_usec: crate::suseconds_t,
347342
#[cfg(all(target_pointer_width = "32", linux_time_bits64))]
348343
pub input_event_usec: c_ulong,
349344

345+
#[cfg(target_arch = "sparc64")]
346+
_pad1: c_int,
350347
pub type_: __u16,
351348
pub code: __u16,
352349
pub value: __s32,

0 commit comments

Comments
 (0)