• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to know OS Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to know OS Version (From: JanakiRam <email@hidden>)

  • Prev by Date: Re: Login Item for All Users
  • Next by Date: Re: How to know OS Version
  • Previous by thread: How to know OS Version
  • Next by thread: Re: How to know OS Version
  • Index(es):
    • Date
    • Thread