From ea3c3f983b8d7d67acf98ea090eae57a0130434e Mon Sep 17 00:00:00 2001 From: Ming Zero <32085760+zm1060@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:19:17 +0800 Subject: [PATCH] Fix building on MinGW: default `WINVER` is too old (#1681) MinGW defaults `WINVER` to something very old, while benchmark requires features gated by `WINVER = 0x0600`, so manually set update to that. --- src/sysinfo.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sysinfo.cc b/src/sysinfo.cc index 922e83ac92..ae6dba90d7 100644 --- a/src/sysinfo.cc +++ b/src/sysinfo.cc @@ -15,6 +15,10 @@ #include "internal_macros.h" #ifdef BENCHMARK_OS_WINDOWS +#if !defined(WINVER) || WINVER < 0x0600 +#undef WINVER +#define WINVER 0x0600 +#endif // WINVER handling #include #undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA #include