Include HIDAPI functions in SDL2 port#26297
Include HIDAPI functions in SDL2 port#26297zturtleman wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
d5944e1 to
6aa4ec4
Compare
sbc100
left a comment
There was a problem hiding this comment.
LGTM, but perhaps we could include this in a test? Maybe modify one of the existing SDL1 tests.
Also, presumably there is no way to actually use the HID API from emscripten without first hooking it up to browser, so its not currently very useful other than to prevent linker errors?
|
You are correct. It fixes linker errors and doesn't provide HID device access. The functions are listed in the library (with this pull request) using this command in the emsdk directory: For what it's worth, there are around ~900 public API functions in SDL2's dynapi list if someone wanted to verify they all exist. Would you like the following added to test_sdl2_misc.c to confirm linking works for two of the functions? // Check if linking works with some of the HIDAPI functions added in SDL 2.0.18.
SDL_hid_init();
SDL_hid_exit(); |
Yes that sounds good. |
Include the stub implementations for SDL_hid_init() and related functions in SDL_hidapi.c that were added in SDL 2.0.18. These functions are built for Emscritpen using the official SDL2 build systems. Including them in Emscripten's SDL2 port solves linker errors for software that use them. Fixes: emscripten-core#26282
6aa4ec4 to
2ca2432
Compare
This pull request updates the SDL2 port to include the stub implementations for SDL_hid_init() and related functions in SDL_hidapi.c that were added in SDL 2.0.18.
These functions are built for Emscritpen using the official SDL2 build systems. Including them in Emscripten's SDL2 port solves linker errors for software that use them.
Fixes: #26282
Additional source files for SDL 2.32.8 don't export any SDL2 API functions so I didn't add them to the source list in sdl2.py.