Skip to content

Commit

Permalink
Fix two C++-Builder 11 issues (#634)
Browse files Browse the repository at this point in the history
* Invert preprocessor condition, as the Microsoft compiler seems to be the special case - not the other way around

* Removed redefinition of typedef 'PHIDP_PREPARSED_DATA' in hidapi_hidsdi.h to match the original hidsdi.h

As reported in #630
  • Loading branch information
JoergAtGithub authored Oct 26, 2023
1 parent 3c04eac commit 86b056f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion windows/hidapi_descriptor_reconstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions windows/hidapi_hidsdi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 86b056f

Please sign in to comment.