llvm.org GIT mirror llvm / b79da9c
Use ::GetVersionEx directly rather than the Win8.1 SDK helpers This removes ifdefs and fixes the build for users of the Win8.0 SDK, which I happen to be. Upgrading is not hard, but executing the same code everywhere seems better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257379 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 3 years ago
1 changed file(s) with 4 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
4646 #include
4747 #include
4848
49 #if !defined(__CYGWIN__) && !defined(__MINGW32__)
50 #include
51 #else
52 // Cygwin does not have the IsWindows8OrGreater() API.
53 // Some version of mingw does not have the API either.
49 /// Determines if the program is running on Windows 8 or newer. This
50 /// reimplements the helpers in the Windows 8.1 SDK, which are intended to
51 /// supercede raw calls to GetVersionEx, because old Windows SDKs, Cygwin, and
52 /// MinGW don't have VersionSupport.h yet.
5453 inline bool IsWindows8OrGreater() {
5554 OSVERSIONINFO osvi = {};
5655 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
5958 return (osvi.dwMajorVersion > 6 ||
6059 (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 2));
6160 }
62 #endif // __CYGWIN__
6361
6462 inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) {
6563 if (!ErrMsg)