diff options
author | Brad King <brad.king@kitware.com> | 2014-11-12 14:35:49 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-11-12 14:35:49 (GMT) |
commit | 7d9611433b2d28ab4b183f4734065867c8887926 (patch) | |
tree | 4e8f557b2f898a30f84347dddc7153c68a851fe0 /Source | |
parent | 9a4afc1f9f3c31923317995c1ed90bb4668596bc (diff) | |
parent | 3a6c3599063dcaf1a19e7987d0486c5e8edf28a1 (diff) | |
download | CMake-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.cxx | 10 |
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(); |