Re: Right way to check system version?
Re: Right way to check system version?
- Subject: Re: Right way to check system version?
- From: Steve Checkoway <email@hidden>
- Date: Fri, 19 May 2006 05:00:28 -0700
On May 19, 2006, at 12:47 AM, Ron Fleckner wrote:
Hi,
I was wondering whether this was a good enough way to see what
system my app is running on. I need to see if it's running on
Jaguar to decide whether to set up a particular UI widget, because
I know it won't work properly on Jaguar.
Here's what I did:
...
I'd like to think there is a simpler, more direct way. I looked at
Gestalt in the docs, but found this at the end of the section about
System Version Selector:
A better way to obtain version information in Mac OS X is to read
the system version information from the following file:
/System/Library/CoreServices/SystemVersion.plist
Never infer the existence of certain hardware or software features
from the responses that Gestalt returns when you pass it this
selector.
int main()
{
OSErr err;
long code;
/* Get system version */
err = Gestalt( gestaltSystemVersion, &code );
if( err == noErr )
{
int major = ( (code >> 12) & 0xF ) * 10 + (code >> 8) & 0xF;
int minor = (code >> 4) & 0xF;
int revision = code & 0xF;
printf( "Mac OS X %d.%d.%d\n", major, minor, revision );
}
return 0;
}
- Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden