From ff913a22f48fa26cbbdaa3c88c431d65d1fea4a7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 23 Dec 2020 16:16:55 -0800 Subject: [PATCH] Fixed compile warnings on platforms without hidapi support --- src/hidapi/SDL_hidapi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index dc2bc49c6..a5c944065 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -804,6 +804,7 @@ void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *d HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number) { +#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || SDL_LIBUSB_DYNAMIC hid_device *pDevice = NULL; if (hid_init() != 0) { @@ -836,11 +837,14 @@ HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsi } #endif /* SDL_LIBUSB_DYNAMIC */ +#endif /* HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || SDL_LIBUSB_DYNAMIC */ + return NULL; } HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path, int bExclusive /* = false */) { +#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || SDL_LIBUSB_DYNAMIC hid_device *pDevice = NULL; if (hid_init() != 0) { @@ -873,6 +877,8 @@ HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path, int bEx } #endif /* SDL_LIBUSB_DYNAMIC */ +#endif /* HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || SDL_LIBUSB_DYNAMIC */ + return NULL; }