How to get system version?
How to get system version?
- Subject: How to get system version?
- From: Chad Jones <email@hidden>
- Date: Fri, 17 Oct 2003 10:21:11 -0700
Hi Giovanni,
You can easily get the system version using the Carbon Gestalt call.
Code I provided below gets and prints out the system version. This
code works from both Carbon and Cocoa you need only include the
Carbon framework in your application.
long SystemVersionInHexDigits;
long MajorVersion, MinorVersion, MinorMinorVersion;
error = Gestalt(gestaltSystemVersion, &SystemVersionInHexDigits);
MinorMinorVersion = SystemVersionInHexDigits & 0xF;
MinorVersion = (SystemVersionInHexDigits & 0xF0)/0xF;
MajorVersion = ((SystemVersionInHexDigits & 0xF000)/0xF00) * 10 +
(SystemVersionInHexDigits & 0xF00)/0xF0;
printf("%ld.%ld.%ld", MajorVersion, MinorVersion, MinorMinorVersion);
>
I wanna perform different code whether I'm in Jaguar or in Panther.
>
But keeping the same application.
>
>
can I get the system version somehow so that I can do:
>
>
if (PANTHER_INSTALLED)
>
{
>
>
}
>
else if (JAGUAR_INSTALLED)
>
{
>
>
}
>
else if (PUMA_INSTALLED)
>
{
>
>
}
>
>
Thanks for your help!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.