From 446d1ee6249a2e5f79756eee455c4916191d6263 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 22 Nov 2016 15:15:53 -0800 Subject: [PATCH] avoid redefining WIN32_LEAN_AND_MEAN fixes redef errors when the macro is supplied elsewhere, e.g., the command line Change-Id: Ic15726817a43e30595d50562ef1f077060c193cf --- test/register_state_check.h | 2 ++ test/video_source.h | 2 ++ vpx_ports/arm_cpudetect.c | 4 ++++ vpx_ports/x86.h | 2 ++ 4 files changed, 10 insertions(+) diff --git a/test/register_state_check.h b/test/register_state_check.h index b8ba34328..84641c8e9 100644 --- a/test/register_state_check.h +++ b/test/register_state_check.h @@ -32,7 +32,9 @@ #undef NOMINMAX #define NOMINMAX +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include diff --git a/test/video_source.h b/test/video_source.h index 424bb2cfb..54f692865 100644 --- a/test/video_source.h +++ b/test/video_source.h @@ -13,7 +13,9 @@ #if defined(_WIN32) #undef NOMINMAX #define NOMINMAX +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #endif #include diff --git a/vpx_ports/arm_cpudetect.c b/vpx_ports/arm_cpudetect.c index 79c60f7a1..4f9d480ad 100644 --- a/vpx_ports/arm_cpudetect.c +++ b/vpx_ports/arm_cpudetect.c @@ -58,8 +58,12 @@ int arm_cpu_caps(void) { #elif defined(_MSC_VER) /* end !CONFIG_RUNTIME_CPU_DETECT */ /*For GetExceptionCode() and EXCEPTION_ILLEGAL_INSTRUCTION.*/ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif +#ifndef WIN32_EXTRA_LEAN #define WIN32_EXTRA_LEAN +#endif #include int arm_cpu_caps(void) { diff --git a/vpx_ports/x86.h b/vpx_ports/x86.h index 11c98fc76..5aabb9e3a 100644 --- a/vpx_ports/x86.h +++ b/vpx_ports/x86.h @@ -142,7 +142,9 @@ static INLINE uint64_t xgetbv(void) { #if defined(_MSC_VER) && _MSC_VER >= 1700 #undef NOMINMAX #define NOMINMAX +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #if WINAPI_FAMILY_PARTITION(WINAPI_FAMILY_APP) #define getenv(x) NULL