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
pull/21876/head
3vilM33pl3 5 years ago committed by GitHub
parent 2a7191abe7
commit 5ae942e6cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      include/grpc/impl/codegen/port_platform.h

@ -46,6 +46,8 @@
#define NOMINMAX
#endif /* NOMINMAX */
#include <windows.h>
#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 <windows.h>
#ifdef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
#undef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
#undef WIN32_LEAN_AND_MEAN

Loading…
Cancel
Save