Fix netbsd build broken by r334950

This also includes one more build fix for windows.

llvm-svn: 334953
This commit is contained in:
Pavel Labath 2018-06-18 15:44:36 +00:00
parent 9d4758ecdd
commit 76ba497177
2 changed files with 4 additions and 11 deletions

View File

@ -26,9 +26,10 @@ llvm::VersionTuple HostInfoNetBSD::GetOSVersion() {
::memset(&un, 0, sizeof(un));
if (::uname(&un) < 0)
return false;
return VersionTuple();
/* Accept versions like 7.99.21 and 6.1_STABLE */
uint32_t major, minor, update;
int status = ::sscanf(un.release, "%" PRIu32 ".%" PRIu32 ".%" PRIu32, &major,
&minor, &update);
switch (status) {

View File

@ -568,16 +568,8 @@ void PlatformWindows::GetStatus(Stream &strm) {
Platform::GetStatus(strm);
#ifdef _WIN32
uint32_t major;
uint32_t minor;
uint32_t update;
if (!HostInfo::GetOSVersion(major, minor, update)) {
strm << "Windows";
return;
}
strm << "Host: Windows " << major << '.' << minor << " Build: " << update
<< '\n';
llvm::VersionTuple version = HostInfo::GetOSVersion();
strm << "Host: Windows " << version.getAsString() << '\n';
#endif
}