From f48a28d12a762feb5469dee397adb91d09bc4cd6 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Tue, 6 Mar 2018 10:15:03 -0800 Subject: [PATCH] Do not let StrCat be renamed to lstrcatA (#546) On Windows the Shlwapi.h file has a macro: #define StrCat lstrcatA And benchmark/src/string_util.h defines StrCat and it is renamed to lstrcatA if we don't undef the macro in Shlwapi.h. This is an innocuous bug if string_util.h is included after Shlwapi.h, but it is a compile error if string_util.h is included before Shlwapi.h. This fixes issue #545. --- src/sysinfo.cc | 1 + src/timers.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/sysinfo.cc b/src/sysinfo.cc index 24ab6d6b..59769e24 100644 --- a/src/sysinfo.cc +++ b/src/sysinfo.cc @@ -16,6 +16,7 @@ #ifdef BENCHMARK_OS_WINDOWS #include +#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA #include #include #else diff --git a/src/timers.cc b/src/timers.cc index 893cd382..701e4577 100644 --- a/src/timers.cc +++ b/src/timers.cc @@ -17,6 +17,7 @@ #ifdef BENCHMARK_OS_WINDOWS #include +#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA #include #include #else