From e736efa13ad42a4245b95774d114720ad0877c5b Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Wed, 14 Sep 2016 09:32:09 -0400
Subject: [PATCH] ConsoleBuf: Always compile test source for host Windows
 version

Undefine any `_WIN32_WINNT` value that may be defined on the compiler
command line by clients that are targeting the build at a different
version of Windows than the host.  We must build for the host APIs in
order for the test to be able to configure its console correctly.  Since
the test binary is not installed it does not matter if it is not built
for the client's target Windows version.

Change-Id: Ic3e79550713384c45baf25aa624efbcb5d49d0a4
---
 testConsoleBuf.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testConsoleBuf.cxx b/testConsoleBuf.cxx
index 591a2d1..3dec097 100644
--- a/testConsoleBuf.cxx
+++ b/testConsoleBuf.cxx
@@ -11,6 +11,12 @@
 ============================================================================*/
 #include "kwsysPrivate.h"
 
+// Ignore Windows version levels defined by command-line flags.  This
+// source needs access to all APIs available on the host in order for
+// the test to run properly.  The test binary is not installed anyway.
+#undef _WIN32_WINNT
+#undef NTDDI_VERSION
+
 #include KWSYS_HEADER(Encoding.hxx)
 
 // Work-around CMake dependency scanning limitation.  This must
-- 
GitLab