Fixed build on older Raspberry Pi environments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c
index f4aa0e8..4761f3e 100644
--- a/src/core/linux/SDL_evdev.c
+++ b/src/core/linux/SDL_evdev.c
@@ -675,6 +675,7 @@ SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item* item) {
static void
SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
{
+#ifdef EVIOCGMTSLOTS
int i, ret;
struct input_absinfo abs_info;
/*
@@ -698,7 +699,6 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
mt_req_code = SDL_calloc(1, mt_req_size);
if (mt_req_code == NULL) {
- SDL_Log("Failed to sync device");
return;
}
@@ -708,7 +708,6 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
ret = ioctl(item->fd, EVIOCGMTSLOTS(mt_req_size), mt_req_code);
if (ret < 0) {
SDL_free(mt_req_code);
- SDL_Log("Failed to sync device");
return;
}
for(i = 0; i < item->touchscreen_data->max_slots; i++) {
@@ -736,7 +735,6 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
ret = ioctl(item->fd, EVIOCGMTSLOTS(mt_req_size), mt_req_code);
if (ret < 0) {
SDL_free(mt_req_code);
- SDL_Log("Failed to sync device");
return;
}
for(i = 0; i < item->touchscreen_data->max_slots; i++) {
@@ -755,7 +753,6 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
ret = ioctl(item->fd, EVIOCGMTSLOTS(mt_req_size), mt_req_code);
if (ret < 0) {
SDL_free(mt_req_code);
- SDL_Log("Failed to sync device");
return;
}
for(i = 0; i < item->touchscreen_data->max_slots; i++) {
@@ -773,12 +770,13 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
ret = ioctl(item->fd, EVIOCGABS(ABS_MT_SLOT), &abs_info);
if (ret < 0) {
SDL_free(mt_req_code);
- SDL_Log("Failed to sync device");
return;
}
item->touchscreen_data->current_slot = abs_info.value;
SDL_free(mt_req_code);
+
+#endif /* EVIOCGMTSLOTS */
}
#if SDL_USE_LIBUDEV