Hello,

this is needed by Cemu, it does not link otherwise.

Best regards
Oleg Tolmatcev
From 1e554c3eefcad72fd904abb159834b1bb99ed343 Mon Sep 17 00:00:00 2001
From: Oleg Tolmatcev <[email protected]>
Date: Sat, 5 Aug 2023 13:33:07 +0200
Subject: [PATCH] add compatibility with C++ to HID headers

---
 mingw-w64-headers/include/hidclass.h | 8 ++++++++
 mingw-w64-headers/include/hidpi.h    | 8 ++++++++
 mingw-w64-headers/include/hidsdi.h   | 8 ++++++++
 mingw-w64-headers/include/hidusage.h | 8 ++++++++
 4 files changed, 32 insertions(+)

diff --git a/mingw-w64-headers/include/hidclass.h 
b/mingw-w64-headers/include/hidclass.h
index fa389c7f..5cd18241 100644
--- a/mingw-w64-headers/include/hidclass.h
+++ b/mingw-w64-headers/include/hidclass.h
@@ -6,6 +6,10 @@
 #include <winapifamily.h>
 #include <basetyps.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
 #define GUID_CLASS_INPUT GUID_DEVINTERFACE_HID
 
@@ -115,4 +119,8 @@ typedef struct _HID_DRIVER_CONFIG {
   ULONG RingBufferSize;
 } HID_DRIVER_CONFIG,*PHID_DRIVER_CONFIG;
 #endif
+
+#ifdef __cplusplus
+}
+#endif
 #endif
diff --git a/mingw-w64-headers/include/hidpi.h 
b/mingw-w64-headers/include/hidpi.h
index 50549781..87ea68ee 100644
--- a/mingw-w64-headers/include/hidpi.h
+++ b/mingw-w64-headers/include/hidpi.h
@@ -26,6 +26,10 @@
 #ifndef __HIDPI_H__
 #define __HIDPI_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
 
 #include <pshpack4.h>
@@ -257,5 +261,9 @@ NTSTATUS NTAPI HidP_TranslateUsagesToI8042ScanCodes (PUSAGE 
ChangedUsageList, UL
 
 #include <poppack.h>
 
+#endif
+
+#ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/mingw-w64-headers/include/hidsdi.h 
b/mingw-w64-headers/include/hidsdi.h
index 7ba1a3e6..0555e32c 100644
--- a/mingw-w64-headers/include/hidsdi.h
+++ b/mingw-w64-headers/include/hidsdi.h
@@ -24,6 +24,10 @@
 #ifndef _HIDSDI_H
 #define _HIDSDI_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
 
 #include <pshpack4.h>
@@ -68,5 +72,9 @@ BOOLEAN NTAPI HidD_SetOutputReport (HANDLE HidDeviceObject, 
PVOID ReportBuffer,
 
 #include <poppack.h>
 
+#endif
+
+#ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/mingw-w64-headers/include/hidusage.h 
b/mingw-w64-headers/include/hidusage.h
index 265dd3b6..bcacc2aa 100644
--- a/mingw-w64-headers/include/hidusage.h
+++ b/mingw-w64-headers/include/hidusage.h
@@ -26,6 +26,10 @@
 #ifndef __HIDUSAGE_H__
 #define __HIDUSAGE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
 
 #define HID_USAGE_PAGE_UNDEFINED ((USAGE) 0x00)
@@ -222,5 +226,9 @@
 
 typedef USHORT USAGE,*PUSAGE;
 
+#endif
+
+#ifdef __cplusplus
+}
 #endif
 #endif
-- 
2.41.0.windows.1

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to