[PATCH libevdev] Match the kernel define for SYN_MAX
Peter Hutterer
peter.hutterer at who-t.net
Mon Sep 2 14:52:31 PDT 2013
Will be defined as 0xf in 3.12, see
http://git.kernel.org/cgit/linux/kernel/git/dtor/input.git/commit/?h=next&id=52764fed5049655926bcecaefd52f0a415ceb105
And add the required ifdef guards for kernels before that.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
libevdev/make-event-names.py | 4 +++-
test/test-event-names.c | 10 ----------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/libevdev/make-event-names.py b/libevdev/make-event-names.py
index 67b963e..e321bd7 100755
--- a/libevdev/make-event-names.py
+++ b/libevdev/make-event-names.py
@@ -103,7 +103,9 @@ def print_mapping_table(bits):
print("#ifndef EVENT_NAMES_H")
print("#define EVENT_NAMES_H")
print("")
- print("#define SYN_MAX 3 /* linux/input.h doesn't define that */")
+ print("#ifndef SYN_MAX /* added in 3.12 */")
+ print("#define SYN_MAX 0xf")
+ print("#endif")
print("")
for prefix in prefixes:
diff --git a/test/test-event-names.c b/test/test-event-names.c
index e31af6f..e7d92bb 100644
--- a/test/test-event-names.c
+++ b/test/test-event-names.c
@@ -39,15 +39,6 @@ START_TEST(test_limits)
}
END_TEST
-START_TEST(test_syn_max)
-{
- ck_assert_msg(libevdev_get_event_code_name(EV_SYN, 4) == NULL,
- "If this test fails, update SYN_MAX and implement new functionality");
-}
-END_TEST
-
-
-
START_TEST(test_type_name)
{
ck_assert_str_eq(libevdev_get_event_type_name(EV_SYN), "EV_SYN");
@@ -281,7 +272,6 @@ event_name_suite(void)
TCase *tc = tcase_create("type limits");
tcase_add_test(tc, test_limits);
- tcase_add_test(tc, test_syn_max);
tcase_add_test(tc, test_event_type_max);
suite_add_tcase(s, tc);
--
1.8.2.1
More information about the Input-tools
mailing list