]> granicus.if.org Git - strace/commit
evdev: do not rely on EVIOC* constants provided in <linux/input.h>
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 13 Oct 2019 15:18:38 +0000 (17:18 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 22 Oct 2019 17:44:08 +0000 (19:44 +0200)
commit73bfda40f86abe8821291c5654421916fb896fa4
tree911313c0bc5717b4da753fa90e75eb48aee4567d
parent2b046bd338a6f035132193a7eb787885c79649a8
evdev: do not rely on EVIOC* constants provided in <linux/input.h>

* xlat/evdev_ioctl_cmds.in: New file.
* configure.ac (AC_CHECK_HEADERS([linux/input.h])): Check for struct
input_keymap_entry and struct input_mask.
* evdev.c [!INPUT_PROP_MAX] (INPUT_PROP_MAX): New macro definition.
(struct_input_keymap_entry, struct_input_mask): New typedefs.
[HAVE_STRUCT_INPUT_KEYMAP_ENTRY]: Add a static_assert to check
that sizeof(struct input_keymap_entry) has the expected value.
[HAVE_STRUCT_INPUT_MASK]: Add a static_assert to check
that sizeof(struct input_mask) has the expected value.
[!EVIOCGPROP] (EVIOCGPROP): New macro definition.
[!EVIOCGMTSLOTS] (EVIOCGMTSLOTS): Likewise.
[!EVIOCGSW] (EVIOCGSW): Likewise.
[!EVIOCGKEYCODE_V2] (keycode_V2_ioctl): Remove guard.
(keycode_V2_ioctl): Change type of ike to struct_input_keymap_entry.
[!EVIOCGMTSLOTS] (mtslots_ioctl): Remove guard.
[!EVIOCGREP || EVIOCSREP] (repeat_ioctl): Likewise.
(evdev_read_ioctl) [!EVIOCGREP] <case EVIOCGREP>: Likewise.
(evdev_read_ioctl) [!EVIOCGKEYCODE_V2] <case EVIOCGKEYCODE_V2>:
Likewise.
(evdev_read_ioctl) [!EVIOCGMTSLOTS] <case EVIOCGMTSLOTS>: Likewise.
(evdev_read_ioctl) [!EVIOCGPROP] <case EVIOCGPROP>: Likewise.
(evdev_read_ioctl) [!EVIOCGSW] <case EVIOCGSW>: Likewise.
(evdev_write_ioctl) [!EVIOCSREP] <case EVIOCSREP>: Likewise.
(evdev_write_ioctl) [!EVIOCSKEYCODE_V2] <case EVIOCSKEYCODE_V2>: Likewise.
(evdev_write_ioctl) [!EVIOCREVOKE] <case EVIOCREVOKE>: Likewise.
(evdev_write_ioctl) [!EVIOCSCLOCKID] <case EVIOCSCLOCKID>: Likewise.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201
configure.ac
evdev.c
xlat/evdev_ioctl_cmds.in [new file with mode: 0644]