• 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: "Sean McBride" <email@hidden>
  • Date: Thu, 20 Nov 2008 21:08:12 -0500
  • Organization: Rogue Research

On 11/15/08 12:40 AM, Michael Ash said:

>>>+ (BOOL)MacOSTigerOrLower
>>>{
>>>     UInt32 version;
>>>     return (Gestalt(gestaltSystemVersion,(SInt32 *) &version) ==
>>>noErr) && (version < 0x01050 );
>>>}
>>
>> Gestalt() is a good approach, but never use gestaltSystemVersion.  See
>> Gestalt.h for why.
>
>I don't think you need to "never use" it. Its failure mode is fairly
>benign and completely documented. If you're only interested in
>checking for numbers under 9, such as in this case, then it works just
>fine.

Well, true enough, but I think my recommendation is still a good idea,
for reasons of style and maintainability.  Someday someone else may need
to change that code.  If one day 10.5.11 is required the codechange is
less straightforward and more error prone.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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>)
 >Re: How do you get the OS X version number in C or C++? (From: chaitanya pandit <email@hidden>)
 >Re: How do you get the OS X version number in C or C++? (From: "Sean McBride" <email@hidden>)
 >Re: How do you get the OS X version number in C or C++? (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: Autorelease Question
  • Next by Date: Re: NSPointerArray + fast enumeration for non-object types?
  • Previous by thread: Re: How do you get the OS X version number in C or C++?
  • Next by thread: Re: How do you get the OS X version number in C or C++?
  • Index(es):
    • Date
    • Thread