Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4785,7 +4785,7 @@ fn test_linux(target: &str) {
});
cfg.skip_struct(|s| match s.ident() {
"utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "itimerspec"
| "timex" | "ntptimeval" | "stat" | "shmid_ds" | "msqid_ds" => true,
| "timex" | "ntptimeval" | "stat" | "shmid_ds" | "msqid_ds" | "input_event" => true,
_ => false,
});

Expand Down
17 changes: 9 additions & 8 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,21 +225,22 @@ s! {
}

pub struct input_event {
// FIXME(1.0): Change to the commented variant, see https://github.com/rust-lang/libc/pull/4148#discussion_r1857511742
// input_event_sec and input_event_usec are preprocessor macros in C.
// On all variants _except_ 32-bit long and 64-bit time_t they actually
// refer to members of input_event.time, a timeval struct.
// The timeval struct has two members of type time_t and suseconds_t.
#[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: Padding<c_int>,
pub type_: __u16,
pub code: __u16,
pub value: __s32,
Expand Down
Loading