Skip to content

Commit c6fcdd3

Browse files
committedNov 6, 2018
[Support] Fix warning: unknown pragma ignored for mingw target
Differential Revision: https://reviews.llvm.org/D54133 llvm-svn: 346218
1 parent 4855b74 commit c6fcdd3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎llvm/lib/Support/Windows/WindowsSupport.h

+4
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@ inline llvm::VersionTuple GetWindowsOSVersion() {
9292
OSVERSIONINFOEX info;
9393
ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
9494
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
95+
#if defined(_MSC_VER)
9596
#pragma warning(push)
9697
#pragma warning(disable : 4996)
98+
#endif // _MSC_VER
9799
// Starting with Microsoft SDK for Windows 8.1, this function is deprecated
98100
// in favor of the new Windows Version Helper APIs. Since we don't specify a
99101
// minimum SDK version, it's easier to simply disable the warning rather than
100102
// try to support both APIs.
101103
if (GetVersionEx((LPOSVERSIONINFO)&info) == 0)
102104
return llvm::VersionTuple();
105+
#if defined(_MSC_VER)
103106
#pragma warning(pop)
107+
#endif // _MSC_VER
104108

105109
return llvm::VersionTuple(info.dwMajorVersion, info.dwMinorVersion, 0,
106110
info.dwBuildNumber);

0 commit comments

Comments
 (0)
Please sign in to comment.