From 91a6d2638d038cb48f82cb2a4a6d0483c3eb1b05 Mon Sep 17 00:00:00 2001 From: Dmitry Kychanov Date: Wed, 31 Dec 2025 14:25:20 +0400 Subject: [PATCH 1/2] Fix compilation with WIN32_LEAN_AND_MEAN --- windows/hid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/windows/hid.c b/windows/hid.c index 59ec617e..f7d16f38 100644 --- a/windows/hid.c +++ b/windows/hid.c @@ -30,6 +30,11 @@ extern "C" { #endif +#ifdef WIN32_LEAN_AND_MEAN +/* This define may be set by IDE/project and it breaks compilation */ +#undef WIN32_LEAN_AND_MEAN +#endif + #include "hidapi_winapi.h" #include From 13c4a65a560f93db0209fb34c2b6628e20b8f25a Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Mon, 2 Mar 2026 01:32:27 +0200 Subject: [PATCH 2/2] more descriptive comment --- windows/hid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/windows/hid.c b/windows/hid.c index f7d16f38..8ef61c49 100644 --- a/windows/hid.c +++ b/windows/hid.c @@ -31,7 +31,8 @@ extern "C" { #endif #ifdef WIN32_LEAN_AND_MEAN -/* This define may be set by IDE/project and it breaks compilation */ +/* It may be set by IDE/project and apparently HIDAPI relies + * on certain Windows headers being included by default. */ #undef WIN32_LEAN_AND_MEAN #endif