From 5ae942e6cca31b42b788869175ec906361cb1ba8 Mon Sep 17 00:00:00 2001 From: 3vilM33pl3 <52446005+3vilM33pl3@users.noreply.github.com> Date: Mon, 3 Feb 2020 17:23:17 +0000 Subject: [PATCH] Move windows.h to before check for minimum version instead of after This tests the value of _WIN32_WINNT before including windows.h. This is the wrong thing to do. If you want to require a minimum version you firts include windows,h and then check _WIN32_WINNT. As described in this issue: https://github.com/microsoft/vcpkg/issues/7281 --- include/grpc/impl/codegen/port_platform.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 98b516b625d..4bc5362a434 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -46,6 +46,8 @@ #define NOMINMAX #endif /* NOMINMAX */ +#include + #ifndef _WIN32_WINNT #error \ "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)" @@ -56,8 +58,6 @@ #endif /* _WIN32_WINNT < 0x0600 */ #endif /* defined(_WIN32_WINNT) */ -#include - #ifdef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED #undef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED #undef WIN32_LEAN_AND_MEAN