Re: How to know OS Version
Re: How to know OS Version
- Subject: Re: How to know OS Version
- From: "Stefan Werner" <email@hidden>
- Date: Sat, 17 Nov 2007 11:53:21 +0100
On Sat, 17 Nov 2007 10:56:50 +0100, JanakiRam <email@hidden>
wrote:
Hi All,
Is there any way to know the operating system version i.e
either Leopard or Tiger ?
Gestalt will do this for you:
long version;
Gestalt(gestaltSystemVersion, &version);
if (version < 0x1040)
{
// older than 10.4
} else if (version < 0x1050)
{
// older than 10.5
} else {
// 10.5 or higher
}
Note that you will need to include the Carbon headers.
Gestalt() is declared as
extern OSErr Gestalt( OSType selector, long * response)
in the 10.4 SDK - I believe the 2nd parameter type has changed in the 10.5
SDK to since long changes to 64 bits in the LP64 model.
-Stefan
--
"The good news is that in 1995 we will have a good operating system and
programming language; the bad news is that they will be Unix and C++."
_______________________________________________
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