Build the hidapi framework and weak link it on Mac OS X
This commit is contained in:
parent
91121ee4bb
commit
39a498c940
2 changed files with 211 additions and 17 deletions
|
@ -551,15 +551,15 @@ HIDAPI_JoystickInit(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__IPHONEOS__) || defined(__TVOS__)
|
||||
/* The hidapi framwork is weak-linked on iOS and tvOS */
|
||||
#if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__TVOS__)
|
||||
/* The hidapi framwork is weak-linked on Apple platforms */
|
||||
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__ */
|
||||
#endif /* __MACOSX__ || __IPHONEOS__ || __TVOS__ */
|
||||
|
||||
if (hid_init() < 0) {
|
||||
SDL_SetError("Couldn't initialize hidapi");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue