• 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
Best practice for OS version and SDK conditionals?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best practice for OS version and SDK conditionals?


  • Subject: Best practice for OS version and SDK conditionals?
  • From: William Bates <email@hidden>
  • Date: Thu, 3 Apr 2008 11:50:47 -0500

I'm updating and trying to put away some code until the next OS revision, and I'm trying to figure out not _how_ - I know this - but the _best_ place to set compiler variables such as MAC_OS_X_VERSION_MAX_ALLOWED;
I'm also trying to work out some of the interactions of these sorts of compiler conditionals with precompiled headers.
A lot of these source files are in areas such as CoreAudio that have changed a lot from OS 10.3 to OS 10.5. My end goal is to get them as self-documented as possible....


Here are some questions:

(1) Should I #include <AvailabilityMacros.h> in my Prefix.pch?
(2) If yes, should I use precede it with #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 etc., type statements, or not?
(3) When compiling, how can I just dump (using #warning or similar) the current setting(s) of compile time variables like MACOSX_DEPLOYMENT_TARGET?
(4) What syntax works on compiler conditionals? For example, (MACOSX_DEPLOYMENT_TARGET > MAC_OS_X_VERSION_10_4) works but >= does not.


I'm happy to hear opinions on practices that are probably matters of style and taste.

  I'm using Xcode 3.1 beta (dare I speak its name?)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Best practice for OS version and SDK conditionals?
      • From: Chris Espinosa <email@hidden>
    • Re: Best practice for OS version and SDK conditionals?
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Xcode 3 custom install location vs Shared workgroup builds
  • Next by Date: Re: Anyone here based in High Wycombe ( UK ) ?
  • Previous by thread: Re: Anyone here based in High Wycombe ( UK ) ?
  • Next by thread: Re: Best practice for OS version and SDK conditionals?
  • Index(es):
    • Date
    • Thread