From 13fbc26a3006598dba457b89d258827b653a3513 Mon Sep 17 00:00:00 2001 From: Dmitry Kychanov Date: Tue, 30 Dec 2025 13:25:40 +0400 Subject: [PATCH] Fix compilation with WIN32_LEAN_AND_MEAN and use it for hid.c --- windows/hid.c | 5 +++++ windows/hidapi_cfgmgr32.h | 1 + 2 files changed, 6 insertions(+) diff --git a/windows/hid.c b/windows/hid.c index 59ec617e0..951ee08ab 100644 --- a/windows/hid.c +++ b/windows/hid.c @@ -30,6 +30,11 @@ extern "C" { #endif +#ifndef WIN32_LEAN_AND_MEAN +/* Reduces the overhead from windows.h */ +#define WIN32_LEAN_AND_MEAN +#endif + #include "hidapi_winapi.h" #include diff --git a/windows/hidapi_cfgmgr32.h b/windows/hidapi_cfgmgr32.h index 638512a8b..19783ee0a 100644 --- a/windows/hidapi_cfgmgr32.h +++ b/windows/hidapi_cfgmgr32.h @@ -32,6 +32,7 @@ /* This part of the header mimics cfgmgr32.h, but only what is used by HIDAPI */ +#include #include #include #include