Don't build SDL_JOYSTICK_HIDAPI by default on iOS

If you enable this, you'll need to link with CoreBluetooth.framework and add something like this to your Info.plist:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
This commit is contained in:
Sam Lantinga
2018-10-26 09:27:31 -07:00
parent 14329256cb
commit b08bdc4401
8 changed files with 26 additions and 76 deletions

View File

@@ -3,6 +3,9 @@
// Purpose: HID device abstraction temporary stub
//
//=============================================================================
#include "../../SDL_internal.h"
#ifdef SDL_JOYSTICK_HIDAPI
#include <CoreBluetooth/CoreBluetooth.h>
#include <QuartzCore/QuartzCore.h>
@@ -907,3 +910,5 @@ int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t
#endif
return result;
}
#endif /* SDL_JOYSTICK_HIDAPI */

View File

@@ -22,6 +22,9 @@
code repository located at:
http://github.com/signal11/hidapi .
********************************************************/
#include "../../SDL_internal.h"
#ifdef SDL_JOYSTICK_HIDAPI
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
@@ -1613,3 +1616,5 @@ uint16_t get_usb_code_for_current_locale(void)
#ifdef NAMESPACE
}
#endif
#endif /* SDL_JOYSTICK_HIDAPI */

View File

@@ -20,6 +20,9 @@
code repository located at:
http://github.com/signal11/hidapi .
********************************************************/
#include "../../SDL_internal.h"
#ifdef SDL_JOYSTICK_HIDAPI
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
@@ -891,3 +894,5 @@ HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev)
#ifdef NAMESPACE
}
#endif
#endif /* SDL_JOYSTICK_HIDAPI */

View File

@@ -19,6 +19,9 @@
code repository located at:
http://github.com/signal11/hidapi .
********************************************************/
#include "../../SDL_internal.h"
#ifdef SDL_JOYSTICK_HIDAPI
/* See Apple Technical Note TN2187 for details on IOHidManager. */
@@ -1184,3 +1187,5 @@ int main(void)
return 0;
}
#endif
#endif /* SDL_JOYSTICK_HIDAPI */

View File

@@ -19,6 +19,9 @@
code repository located at:
http://github.com/signal11/hidapi .
********************************************************/
#include "../../SDL_internal.h"
#ifdef SDL_JOYSTICK_HIDAPI
#include <windows.h>
@@ -39,7 +42,6 @@ typedef LONG NTSTATUS;
#endif
/* SDL C runtime functions */
#include "../../SDL_internal.h"
#include "SDL_stdinc.h"
#define calloc SDL_calloc
@@ -982,3 +984,5 @@ int __cdecl main(int argc, char* argv[])
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SDL_JOYSTICK_HIDAPI */