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 4656 - SDL_evdev.c uses Linux specific integer types
Summary: SDL_evdev.c uses Linux specific integer types
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.9
Hardware: x86 Other
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-05 13:07 UTC by Jan Martin Mikkelsen
Modified: 2019-06-05 15:54 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 Jan Martin Mikkelsen 2019-06-05 13:07:16 UTC
The file src/core/linux/SDL_evdev.c uses the Linux specific types __u32 and __s32. This breaks things on FreeBSD when building with evdev.

Patch:

diff -dur SDL2-2.0.9.orig/src/core/linux/SDL_evdev.c SDL2-2.0.9/src/core/linux/SDL_evdev.c       
--- SDL2-2.0.9.orig/src/core/linux/SDL_evdev.c  2018-10-31 16:07:22.000000000 +0100      
+++ SDL2-2.0.9/src/core/linux/SDL_evdev.c       2019-05-29 18:32:01.620472000 +0200
@@ -512,8 +512,8 @@
      *
      * this is the structure we're trying to emulate
      */
-    __u32* mt_req_code;
-    __s32* mt_req_values;
+    uint32_t* mt_req_code;
+    int32_t* mt_req_values;
     size_t mt_req_size;
 
     /* TODO: sync devices other than touchscreen */
@@ -528,7 +528,7 @@
         return;
     }
 
-    mt_req_values = (__s32*)mt_req_code + 1;
+    mt_req_values = (int32_t*)mt_req_code + 1;
 
     *mt_req_code = ABS_MT_TRACKING_ID;
     ret = ioctl(item->fd, EVIOCGMTSLOTS(mt_req_size), mt_req_code);
Comment 1 Sam Lantinga 2019-06-05 15:54:21 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/728c6562100f