Skip to content

Commit 81e3066

Browse files
sezeroslouken
authored andcommitted
hidapi/libusb: disable C5287 warning in MSVC builds
A quick search implies that it is a bogus warning: https://www.google.com/search?q=visual+studio+C5287
1 parent 7d9fd48 commit 81e3066

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/hidapi/libusb/hid.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ extern "C" {
7171
#define DETACH_KERNEL_DRIVER
7272
#endif
7373

74+
#if defined(_MSC_VER)
75+
#pragma warning(push)
76+
#pragma warning(disable:5287) /* operands are different enum types */
77+
#endif
78+
7479
/* Uncomment to enable the retrieval of Usage and Usage Page in
7580
hid_enumerate(). Warning, on platforms different from FreeBSD
7681
this is very invasive as it requires the detach
@@ -2144,6 +2149,10 @@ uint16_t get_usb_code_for_current_locale(void)
21442149
return 0x0;
21452150
}
21462151

2152+
#if defined(_MSC_VER)
2153+
#pragma warning (pop)
2154+
#endif
2155+
21472156
#ifdef __cplusplus
21482157
}
21492158
#endif

0 commit comments

Comments
 (0)