Bläddra i källkod

Fixed compile warnings on platforms without hidapi support

Sam Lantinga 4 år sedan
förälder
incheckning
ff913a22f4
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      src/hidapi/SDL_hidapi.c

+ 6 - 0
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;
 }