From f705e2f9f71fe0d329f773a699083f5ef4ad7590 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 10 Apr 2025 09:57:37 -0700
Subject: [PATCH] Fixed conflict when linking both SDL and hidapi statically
Fixes https://github.com/libsdl-org/SDL/issues/12790
(cherry picked from commit 98e76d283fd164005d07ab5e95bc01b398a7ab91)
---
src/hidapi/SDL_hidapi_windows.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/hidapi/SDL_hidapi_windows.h b/src/hidapi/SDL_hidapi_windows.h
index c29122ba67b33..91f71c2079396 100644
--- a/src/hidapi/SDL_hidapi_windows.h
+++ b/src/hidapi/SDL_hidapi_windows.h
@@ -62,6 +62,10 @@
#define wcsstr SDL_wcsstr
#define wcstol SDL_wcstol
+// These functions conflict when linking both SDL and hidapi statically
+#define hid_winapi_descriptor_reconstruct_pp_data SDL_hid_winapi_descriptor_reconstruct_pp_data
+#define hid_winapi_get_container_id SDL_hid_winapi_get_container_id
+
#undef HIDAPI_H__
#include "windows/hid.c"
#define HAVE_PLATFORM_BACKEND 1