summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-11 13:55:58 (GMT)
committerBrad King <brad.king@kitware.com>2014-11-11 13:55:58 (GMT)
commit3a6c3599063dcaf1a19e7987d0486c5e8edf28a1 (patch)
treed09d7e3486921fe27eac76ff07919cbc0eb1eace /Source/cmGlobalGenerator.cxx
parentdd563e1eb3002578fcc28f9cc4ef9d2326043a23 (diff)
downloadCMake-3a6c3599063dcaf1a19e7987d0486c5e8edf28a1.zip
CMake-3a6c3599063dcaf1a19e7987d0486c5e8edf28a1.tar.gz
CMake-3a6c3599063dcaf1a19e7987d0486c5e8edf28a1.tar.bz2
Suppress deprecation warnings for GetVersionEx
Visual Studio 12 (2013) deprecated GetVersionEx: warning C4996: 'GetVersionExW': was declared deprecated in favor of either "versionhelpers.h" or VerifyVersionInfo, neither of which exist in some of the older compilers we support. Rather than try to port conditionally to VerifyVersionInfo, simply suppress the warning for now.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-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();