From f622f21e6fbea10dec861b5918a4b7cbf996d0c7 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 15 Sep 2023 05:17:33 -0700
Subject: [PATCH] Fixed build
---
src/hidapi/SDL_hidapi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c
index 929ed9e6a8f9..b31683b36e91 100644
--- a/src/hidapi/SDL_hidapi.c
+++ b/src/hidapi/SDL_hidapi.c
@@ -904,7 +904,7 @@ static SDL_bool IsInWhitelist(Uint16 vendor, Uint16 product)
#endif /* !SDL_HIDAPI_DISABLED */
-#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND
+#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND)
/* We have another way to get HID devices, so use the whitelist to get devices where libusb is preferred */
#define SDL_HIDAPI_LIBUSB_WHITELIST_DEFAULT SDL_TRUE
#else
@@ -1345,6 +1345,7 @@ static void AddDeviceToEnumeration(const char *driver_name, struct hid_device_in
*last = new_dev;
}
+#if defined(HAVE_LIBUSB) || defined(HAVE_PLATFORM_BACKEND)
static void RemoveDeviceFromEnumeration(const char *driver_name, struct hid_device_info *dev, struct hid_device_info **devs, void (*free_device_info)(struct hid_device_info *))
{
struct hid_device_info *last = NULL, *curr, *next;
@@ -1374,6 +1375,7 @@ static void RemoveDeviceFromEnumeration(const char *driver_name, struct hid_devi
last = curr;
}
}
+#endif /* HAVE_LIBUSB || HAVE_PLATFORM_BACKEND */
#ifdef HAVE_LIBUSB
static void RemoveNonWhitelistedDevicesFromEnumeration(struct hid_device_info **devs, void (*free_device_info)(struct hid_device_info *))