Skip to content

Commit

Permalink
Fixed build on older Raspberry Pi environments
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 1, 2016
1 parent a0d3e0d commit ac7d117
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/linux/SDL_evdev.c
Expand Up @@ -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;
/*
Expand All @@ -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;
}

Expand All @@ -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++) {
Expand Down Expand Up @@ -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++) {
Expand All @@ -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++) {
Expand All @@ -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
Expand Down

0 comments on commit ac7d117

Please sign in to comment.