summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-12 14:35:49 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-11-12 14:35:49 (GMT)
commit7d9611433b2d28ab4b183f4734065867c8887926 (patch)
tree4e8f557b2f898a30f84347dddc7153c68a851fe0 /Source
parent9a4afc1f9f3c31923317995c1ed90bb4668596bc (diff)
parent3a6c3599063dcaf1a19e7987d0486c5e8edf28a1 (diff)
downloadCMake-7d9611433b2d28ab4b183f4734065867c8887926.zip
CMake-7d9611433b2d28ab4b183f4734065867c8887926.tar.gz
CMake-7d9611433b2d28ab4b183f4734065867c8887926.tar.bz2
Merge topic 'fix-vs12-GetVersionEx-warning'
3a6c3599 Suppress deprecation warnings for GetVersionEx
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a729c3d..aec47fb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -11,6 +11,9 @@
============================================================================*/
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "windows.h" // this must be first to define GetCurrentDirectory
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+#endif
#endif
#include "cmGlobalGenerator.h"
@@ -456,7 +459,14 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (push)
+# pragma warning (disable:4996)
+#endif
GetVersionEx (&osvi);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (pop)
+#endif
cmOStringStream windowsVersionString;
windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion;
windowsVersionString.str();