-
Notifications
You must be signed in to change notification settings - Fork 1.2k
linux: Use the input_event_X macros to access input_event members #4654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
Comment on lines
+345
to
+346
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to backport this part of the change. It is technically breaking but our definition is incorrect without it, and sparc64 isn't all that popular of a target. Would you be able to split this to a separate commit? Padding fields should also get wrapped in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm - actually, I think this change may not be correct on its own. Looks like the We should probably do that change still to make sure users don't expect the upper half of that field to work, just annoying that sparc has a special-cased (context: torvalds/linux@2e74694)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, I see now that the field is of type |
||
| pub type_: __u16, | ||
| pub code: __u16, | ||
| pub value: __s32, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment that these are actually combined as
timeval?