mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 14:08:28 +00:00
Weak link the hidapi framework on iOS and tvOS
This commit is contained in:
@@ -551,6 +551,16 @@ HIDAPI_JoystickInit(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__IPHONEOS__) || defined(__TVOS__)
|
||||
/* The hidapi framwork is weak-linked on iOS and tvOS */
|
||||
int HID_API_EXPORT HID_API_CALL hid_init(void) __attribute__((weak_import));
|
||||
|
||||
if (hid_init == NULL) {
|
||||
SDL_SetError("Couldn't initialize hidapi, framework not available");
|
||||
return -1;
|
||||
}
|
||||
#endif /* __IPHONEOS__ || __TVOS__ */
|
||||
|
||||
if (hid_init() < 0) {
|
||||
SDL_SetError("Couldn't initialize hidapi");
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user