diff options
author | Reid Kleckner <rnk@google.com> | 2016-01-11 20:35:45 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-01-11 20:35:45 +0000 |
commit | ffbe12f4c56159ffbe84fcd23212f312c3c7214a (patch) | |
tree | a41dae9b485a6a00cf35eac947ec7c34154a5b58 /llvm/lib/Support | |
parent | 1a78c6322cbe889fdb173005864a48aa7da947e6 (diff) | |
download | bcm5719-llvm-ffbe12f4c56159ffbe84fcd23212f312c3c7214a.tar.gz bcm5719-llvm-ffbe12f4c56159ffbe84fcd23212f312c3c7214a.zip |
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.
llvm-svn: 257379
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/Windows/WindowsSupport.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Support/Windows/WindowsSupport.h b/llvm/lib/Support/Windows/WindowsSupport.h index c65e3148921..cb091f18640 100644 --- a/llvm/lib/Support/Windows/WindowsSupport.h +++ b/llvm/lib/Support/Windows/WindowsSupport.h @@ -47,11 +47,10 @@ #include <string> #include <vector> -#if !defined(__CYGWIN__) && !defined(__MINGW32__) -#include <VersionHelpers.h> -#else -// Cygwin does not have the IsWindows8OrGreater() API. -// Some version of mingw does not have the API either. +/// Determines if the program is running on Windows 8 or newer. This +/// reimplements the helpers in the Windows 8.1 SDK, which are intended to +/// supercede raw calls to GetVersionEx, because old Windows SDKs, Cygwin, and +/// MinGW don't have VersionSupport.h yet. inline bool IsWindows8OrGreater() { OSVERSIONINFO osvi = {}; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -60,7 +59,6 @@ inline bool IsWindows8OrGreater() { return (osvi.dwMajorVersion > 6 || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 2)); } -#endif // __CYGWIN__ inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) { if (!ErrMsg) |