forked from nrj/OneWay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SystemVersion.m
40 lines (30 loc) · 876 Bytes
/
SystemVersion.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// SystemVersion.m
// OneWay
//
// Created by nrj on 3/14/10.
// Copyright 2010 cocoaism.com. All rights reserved.
//
#import "SystemVersion.h"
@implementation SystemVersion
+ (BOOL)isLeopard
{
OSErr err;
SInt32 versionMajor, versionMinor;
if ((err = Gestalt(gestaltSystemVersionMajor, &versionMajor)) != noErr || (err = Gestalt(gestaltSystemVersionMinor, &versionMinor)) != noErr)
{
NSLog(@"Unable to determine system version");
}
return (versionMajor == 10 && versionMinor == 5);
}
+ (BOOL)isSnowLeopard
{
OSErr err;
SInt32 versionMajor, versionMinor;
if ((err = Gestalt(gestaltSystemVersionMajor, &versionMajor)) != noErr || (err = Gestalt(gestaltSystemVersionMinor, &versionMinor)) != noErr)
{
NSLog(@"Unable to determine system version");
}
return (versionMajor == 10 && versionMinor == 6);
}
@end