Skip to content

Commit

Permalink
White-listed the 4th generation (mid-2010) Mac mini
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Zitzmann authored and Nick Zitzmann committed Apr 17, 2011
1 parent feca1e2 commit 4234512
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions WhenIm64Pref.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ - (BOOL)isComputerProbablySupportedBy64BitKernel
// If it's not on the list, then return YES.
// There are a number of 32-bit-only Macs for which this method will return YES, so don't rely on this method entirely...

if ([hwModel hasPrefix:@"Macmini"]) // the documentation says Mac minis aren't supported at all
return NO;
if ([hwModel hasPrefix:@"Macmini"]) // Mac minis are supported from the 4th generation onwards
{
if ([hwModel hasSuffix:@"1,1"] || [hwModel hasSuffix:@"2,1"] || [hwModel hasSuffix:@"3,1"])
return NO;
}
else if ([hwModel hasPrefix:@"MacBook"])
{
if ([hwModel rangeOfString:@"MacBookPro"].location == NSNotFound) // non-Pro MacBooks aren't supported
Expand Down Expand Up @@ -299,23 +302,11 @@ - (NSDictionary *)nvram
{
NSData *results = [self outputOfTaskWithLaunchPath:@"/usr/sbin/nvram" arguments:[NSArray arrayWithObject:@"-xp"]];
NSDictionary *returnValue;

#ifdef __LP64__
NSError *err = nil;

returnValue = [NSPropertyListSerialization propertyListWithData:results options:NSPropertyListImmutable format:NULL error:&err];
if (returnValue == nil && err)
NSLog(@"Couldn't read nvram property list (64-bit): %@", err);
#else
NSString *err = nil;

returnValue = [NSPropertyListSerialization propertyListFromData:results mutabilityOption:NSPropertyListImmutable format:NULL errorDescription:&err];
if (returnValue == nil && err)
{
NSLog(@"Couldn't read nvram property list (32-bit): %@", err);
[err release]; // the documentation says we have to do this, oddly enough
}
#endif
return returnValue;
}

Expand Down

0 comments on commit 4234512

Please sign in to comment.