• 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 do you get the OS X version number in C or C++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you get the OS X version number in C or C++?


  • Subject: Re: How do you get the OS X version number in C or C++?
  • From: Rob Keniger <email@hidden>
  • Date: Sat, 15 Nov 2008 16:28:14 +1000


On 15/11/2008, at 6:06 AM, Tom Fortmann wrote:

Is there a core foundation function for querying the Mac OS X operating
system name and version information? The uname() API returns the Darwin
kernel version information, but I need to find the OS X 10.x.x information.


This is the way you should do it:

SInt32 majorVersion,minorVersion,bugFixVersion;

Gestalt(gestaltSystemVersionMajor, &majorVersion);
Gestalt(gestaltSystemVersionMinor, &minorVersion);
Gestalt(gestaltSystemVersionBugFix, &bugFixVersion);

NSLog(@"Running on Mac OS X %d.%d. %d",majorVersion,minorVersion,bugFixVersion);

--
Rob Keniger



_______________________________________________

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 do you get the OS X version number in C or C++? (From: "Tom Fortmann" <email@hidden>)

  • Prev by Date: Re: How do you get the OS X version number in C or C++?
  • Next by Date: NSOutlineView setDoubleAction: working on 10.5, but not on 10.4.11
  • Previous by thread: Re: How do you get the OS X version number in C or C++?
  • Next by thread: Tabbing PDF Annotation Editor between annotations in "edit mode"?
  • Index(es):
    • Date
    • Thread