From ea7a562a69a558519cbccd8ba2343d5436c7ba64 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 4 Jul 2017 17:41:46 +1000 Subject: [PATCH] udev: move the KEY_* defines to missing.h (#6278) --- src/basic/missing.h | 9 +++++++++ src/udev/udev-builtin-input_id.c | 12 +----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/basic/missing.h b/src/basic/missing.h index a563187..66aee40 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -1073,6 +1073,15 @@ struct input_mask { #define INPUT_PROP_ACCELEROMETER 0x06 #endif +#ifndef BTN_DPAD_UP +#define BTN_DPAD_UP 0x220 +#define BTN_DPAD_RIGHT 0x223 +#endif + +#ifndef KEY_ALS_TOGGLE +#define KEY_ALS_TOGGLE 0x230 +#endif + #ifndef HAVE_KEY_SERIAL_T typedef int32_t key_serial_t; #endif diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index 1b61972..60f760e 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -31,6 +31,7 @@ #include #include "fd-util.h" +#include "missing.h" #include "stdio-util.h" #include "string-util.h" #include "udev.h" @@ -44,17 +45,6 @@ #define LONG(x) ((x)/BITS_PER_LONG) #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) -/* available as of kernel 3.11 */ -#ifndef BTN_DPAD_UP -#define BTN_DPAD_UP 0x220 -#define BTN_DPAD_RIGHT 0x223 -#endif /* BTN_DPAD_UP */ - -/* available as of kernel 3.13 */ -#ifndef KEY_ALS_TOGGLE -#define KEY_ALS_TOGGLE 0x230 -#endif /* KEY_ALS_TOGGLE */ - struct range { unsigned start; unsigned end; -- 2.7.4