From bce126085a9d5f71467895004a577e363d3db31b Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Thu, 26 Oct 2023 21:08:17 +0200 Subject: [PATCH 1/2] Invert preprocessor condition, as the Microsoft compiler seems to be the special case - not the other way around --- windows/hidapi_descriptor_reconstruct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/hidapi_descriptor_reconstruct.h b/windows/hidapi_descriptor_reconstruct.h index ae6cb1333..6582dcf26 100644 --- a/windows/hidapi_descriptor_reconstruct.h +++ b/windows/hidapi_descriptor_reconstruct.h @@ -213,7 +213,7 @@ typedef struct hidp_preparsed_data_ { USHORT FirstByteOfLinkCollectionArray; USHORT NumberLinkCollectionNodes; -#if defined(__MINGW32__) || defined(__CYGWIN__) +#ifndef _MSC_VER // MINGW fails with: Flexible array member in union not supported // Solution: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html union { From bcaaa1a693e4d498b6b7ba7b863bf223443cdd3a Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Thu, 26 Oct 2023 21:11:24 +0200 Subject: [PATCH 2/2] Removed redefinition of typedef 'PHIDP_PREPARSED_DATA' in hidapi_hidsdi.h to match the original hidsdi.h --- windows/hidapi_hidsdi.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/windows/hidapi_hidsdi.h b/windows/hidapi_hidsdi.h index 453f89973..4da6b91d8 100644 --- a/windows/hidapi_hidsdi.h +++ b/windows/hidapi_hidsdi.h @@ -40,8 +40,6 @@ typedef struct _HIDD_ATTRIBUTES{ USHORT VersionNumber; } HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES; -typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA; - typedef void (__stdcall *HidD_GetHidGuid_)(LPGUID hid_guid); typedef BOOLEAN (__stdcall *HidD_GetAttributes_)(HANDLE device, PHIDD_ATTRIBUTES attrib); typedef BOOLEAN (__stdcall *HidD_GetSerialNumberString_)(HANDLE device, PVOID buffer, ULONG buffer_len);