forked from OSchip/llvm-project
[Support] Fix `warning: unknown pragma ignored` for mingw target
Differential Revision: https://reviews.llvm.org/D54133 llvm-svn: 346218
This commit is contained in:
parent
4855b74f8b
commit
c6fcdd3b30
|
@ -92,15 +92,19 @@ inline llvm::VersionTuple GetWindowsOSVersion() {
|
|||
OSVERSIONINFOEX info;
|
||||
ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
|
||||
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4996)
|
||||
#endif // _MSC_VER
|
||||
// Starting with Microsoft SDK for Windows 8.1, this function is deprecated
|
||||
// in favor of the new Windows Version Helper APIs. Since we don't specify a
|
||||
// minimum SDK version, it's easier to simply disable the warning rather than
|
||||
// try to support both APIs.
|
||||
if (GetVersionEx((LPOSVERSIONINFO)&info) == 0)
|
||||
return llvm::VersionTuple();
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif // _MSC_VER
|
||||
|
||||
return llvm::VersionTuple(info.dwMajorVersion, info.dwMinorVersion, 0,
|
||||
info.dwBuildNumber);
|
||||
|
|
Loading…
Reference in New Issue