From f940a975009c43b9e0d70e779de274bbcf9ace42 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 27 Jan 2018 14:43:06 +0100 Subject: [PATCH] Linux: Add support for kernels < v2.6.39 Broke build for me on CentOS-6, which sports a 2.6.32 kernel: http://www.cpantesters.org/cpan/report/d956d128-0339-11e8-b0d1-b6c4abd39192 CentOS-6 is supported till 2020-11-30. Closes #1196. --- README.md | 2 ++ src/linux_joystick.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 6ad0b9ef..b2d0d01a 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,8 @@ information on what to include when reporting a bug. - [X11] Bugfix: Selection I/O reported but did not support `COMPOUND_TEXT` - [X11] Bugfix: Latin-1 text read from selections was not converted to UTF-8 - [X11] Bugfix: NVidia EGL would segfault if unloaded before closing the display +- [Linux] Added workaround for missing `SYN_DROPPED` in pre-2.6.39 kernel + headers (#1196) - [Linux] Moved to evdev for joystick input (#906,#1005) - [Linux] Bugfix: Event processing did not detect joystick disconnection (#932) - [Linux] Bugfix: The joystick device path could be truncated (#1025) diff --git a/src/linux_joystick.c b/src/linux_joystick.c index d73961fb..2777d0b3 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -38,6 +38,11 @@ #include #include +#ifndef SYN_DROPPED // < v2.6.39 kernel headers +// Workaround for CentOS-6, which is supported till 2020-11-30, but still on v2.6.32 +#define SYN_DROPPED 3 +#endif + // Apply an EV_KEY event to the specified joystick // static void handleKeyEvent(_GLFWjoystick* js, int code, int value)