Fix lldb build on older OSX versions after svn commit r244716

Older OSX versions don't define NSOperatingSystemVersion, so building
lldb gets: error: unknown type name 'NSOperatingSystemVersion'
This patch fixes the build by having GetOSVersionNumbers return false if
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000, causing lldb to
behave the same as it did before the commit.

Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12396

llvm-svn: 246138
This commit is contained in:
Dawn Perchik 2015-08-27 03:42:56 +00:00
parent 6b716218fa
commit f71e8370d1
1 changed files with 2 additions and 0 deletions

View File

@ -2027,6 +2027,7 @@ MachProcess::GetOSVersionNumbers (uint64_t *major, uint64_t *minor, uint64_t *pa
{
bool success = false;
#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000)
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSOperatingSystemVersion vers = [[NSProcessInfo processInfo] operatingSystemVersion];
@ -2040,6 +2041,7 @@ MachProcess::GetOSVersionNumbers (uint64_t *major, uint64_t *minor, uint64_t *pa
success = true;
[pool drain];
#endif
return success;
}