• 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: Right way to check system version?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right way to check system version?


  • Subject: Re: Right way to check system version?
  • From: "Finlay Dobbie" <email@hidden>
  • Date: Fri, 19 May 2006 15:06:34 +0100

On 19/05/06, Steve Checkoway <email@hidden> wrote:
       /* Get system version */
       err = Gestalt( gestaltSystemVersion, &code );
       if( err == noErr )
       {
               int major = ( (code >> 12) & 0xF ) * 10 + (code >> 8) & 0xF;
               int minor = (code >> 4) & 0xF;
               int revision = code & 0xF;

No need to extract the individual components, just have an comparison: if (code >= 0x1030) // we're on panther or newer

-- Finlay

               printf( "Mac OS X %d.%d.%d\n", major, minor, revision );
       }
       return 0;
}

- Steve

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Right way to check system version? (From: Ron Fleckner <email@hidden>)
 >Re: Right way to check system version? (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: NSPopUpButtons in tableViews
  • Next by Date: Re: How to create slider programmatically
  • Previous by thread: Re: Right way to check system version?
  • Next by thread: Re: Right way to check system version?
  • Index(es):
    • Date
    • Thread