diff options
author | Brad King <brad.king@kitware.com> | 2015-09-11 15:04:01 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-09-11 15:04:01 (GMT) |
commit | 118137538184ff5caba54e28f26fe48834049b07 (patch) | |
tree | 0e228f0f157668f7cc919bf293782fb298f5c13a | |
parent | 24b7e3f8fdb3385a577d5d6bbb17e69ee53d10bc (diff) | |
parent | 4c7744c891b878d9c8298f7e861e2475081abb06 (diff) | |
download | CMake-118137538184ff5caba54e28f26fe48834049b07.zip CMake-118137538184ff5caba54e28f26fe48834049b07.tar.gz CMake-118137538184ff5caba54e28f26fe48834049b07.tar.bz2 |
Merge topic 'revert-fix-windows-version-detection'
4c7744c8 Revert "Windows: Fix CMAKE_HOST_SYSTEM_VERSION on Windows >= 8.1 (#15674)"
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 49f3b29..ee1b192 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -14,20 +14,6 @@ #if defined(_MSC_VER) && _MSC_VER >= 1800 # define KWSYS_WINDOWS_DEPRECATED_GetVersionEx #endif -typedef struct { - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - WCHAR szCSDVersion[128]; - USHORT wServicePackMajor; - USHORT wServicePackMinor; - USHORT wSuiteMask; - UCHAR wProductType; - UCHAR wReserved; -} CMRTL_OSVERSIONINFOEXW; - #endif #include "cmGlobalGenerator.h" @@ -446,45 +432,23 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, if (!mf->GetDefinition("CMAKE_SYSTEM")) { #if defined(_WIN32) && !defined(__CYGWIN__) - CMRTL_OSVERSIONINFOEXW osviex; - ZeroMemory(&osviex, sizeof(osviex)); - osviex.dwOSVersionInfoSize = sizeof(osviex); - - typedef LONG (FAR WINAPI *cmRtlGetVersion)(CMRTL_OSVERSIONINFOEXW*); - cmRtlGetVersion rtlGetVersion = reinterpret_cast<cmRtlGetVersion>( - GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlGetVersion")); - if (rtlGetVersion && rtlGetVersion(&osviex) == 0) - { - std::ostringstream windowsVersionString; - windowsVersionString << osviex.dwMajorVersion << "." - << osviex.dwMinorVersion << "." - << osviex.dwBuildNumber; - windowsVersionString.str(); - mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", - windowsVersionString.str().c_str()); - } - else - { - // RtlGetVersion failed, so use the deprecated GetVersionEx function. - /* Windows version number data. */ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(osvi)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + /* Windows version number data. */ + 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); + GetVersionEx (&osvi); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) #endif - std::ostringstream windowsVersionString; - windowsVersionString << osvi.dwMajorVersion << "." - << osvi.dwMinorVersion; - windowsVersionString.str(); - mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", - windowsVersionString.str().c_str()); - } + std::ostringstream windowsVersionString; + windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; + windowsVersionString.str(); + mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", + windowsVersionString.str().c_str()); #endif // Read the DetermineSystem file std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake"); |