[llvm] r257379 - Use ::GetVersionEx directly rather than the Win8.1 SDK helpers
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 12:35:45 PST 2016
Author: rnk
Date: Mon Jan 11 14:35:45 2016
New Revision: 257379
URL: http://llvm.org/viewvc/llvm-project?rev=257379&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Support/Windows/WindowsSupport.h
Modified: llvm/trunk/lib/Support/Windows/WindowsSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/WindowsSupport.h?rev=257379&r1=257378&r2=257379&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/WindowsSupport.h (original)
+++ llvm/trunk/lib/Support/Windows/WindowsSupport.h Mon Jan 11 14:35:45 2016
@@ -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)
More information about the llvm-commits
mailing list