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.
This commit is contained in:
Wink Saville 2018-03-06 10:15:03 -08:00 committed by Dominic Hamon
parent 69a52cff4f
commit f48a28d12a
2 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#ifdef BENCHMARK_OS_WINDOWS
#include <Shlwapi.h>
#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA
#include <VersionHelpers.h>
#include <Windows.h>
#else

View File

@ -17,6 +17,7 @@
#ifdef BENCHMARK_OS_WINDOWS
#include <Shlwapi.h>
#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA
#include <VersionHelpers.h>
#include <Windows.h>
#else