We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3473 - can't build on linux with an old kernel
Summary: can't build on linux with an old kernel
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.5
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-27 18:04 UTC by Ozkan Sezer
Modified: 2016-11-01 17:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2016-10-27 18:04:25 UTC
On a Linux-x86 system with 2.6.27.25 kernel:

/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c: In function 'SDL_EVDEV_Poll':
/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c:454: error: 'ABS_MT_SLOT' undeclared (first use in this function)
/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c:454: error: (Each undeclared identifier is reported only once
/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c:454: error: for each function it appears in.)
/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c:459: error: 'ABS_MT_TRACKING_ID' undeclared (first use in this function)
/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c:469: error: 'ABS_MT_POSITION_X' undeclared (first use in this function)
/home/me/SDL2-2.0.5/src/core/linux/SDL_evdev.c:477: error: 'ABS_MT_POSITION_Y' undeclared (first use in this function)


Applying the following makes it compile:

diff -r fbf9b0e3589a src/core/linux/SDL_evdev.c
--- a/src/core/linux/SDL_evdev.c	Sat Oct 22 17:53:03 2016 -0700
+++ b/src/core/linux/SDL_evdev.c	Thu Oct 27 19:54:15 2016 +0200
@@ -57,6 +57,14 @@
 #define SYN_DROPPED 3
 #endif
 
+/* These are not defined in older Linux kernel headers. */
+#ifndef ABS_MT_SLOT
+#define ABS_MT_SLOT         0x2f
+#define ABS_MT_POSITION_X   0x35
+#define ABS_MT_POSITION_Y   0x36
+#define ABS_MT_TRACKING_ID  0x39
+#endif
+
 typedef struct SDL_evdevlist_item
 {
     char *path;
Comment 1 Sam Lantinga 2016-11-01 17:34:03 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/0fb14a4fca0b