Re: Finding os version at compile time and os version at runtime?
Re: Finding os version at compile time and os version at runtime?
- Subject: Re: Finding os version at compile time and os version at runtime?
- From: Nik Youdale <email@hidden>
- Date: Sun, 16 Dec 2007 13:59:54 +1100
I made a little class once that gets the OS version at runtime. It
worked on Tiger, haven't used it for a long time though.
+ (SInt32)macOSVersion
{
SInt32 MacVersion;
if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr) {
return MacVersion;
}
else
return 0;
}
The Gestalt function is a carbon function, so I guess it won't work on
leopard.
On 16/12/2007, at 12:06 PM, Jerry LeVan wrote:
Hi,
I have an app I am trying to maintain with one set of sources.
The app uses the quartz filter manager and some leopard pdfkit
stuff that is not available in the 10.4 universal sdk.
I would like to be able to detect the target os version at
compile time so I can prevent the 10.5 stuff from compiling
when I am building a universal version. ( It is all in
a single subroutine).
I also need to be able to detect at runtime if the app
is running a version < 10.5 so I can disable the menu
that invokes the 10.5 code.
Is there a standard way for doing both of these tasks?
Thanks,
Jerry
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden