• 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
Determining which SDK I'm compiling against
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining which SDK I'm compiling against


  • Subject: Determining which SDK I'm compiling against
  • From: Andrew Thompson <email@hidden>
  • Date: Wed, 15 Sep 2004 23:59:48 -0400

Hi all,

I want to use a constant (enum value) that's only available on Panther. Something like this

#include <Appearance.h>
#ifdef PANTHER_OR_LATER //how does one do this?
FOO=kThemeResizeUpCursor
#else
FOO=19
#endif

The point here is this code may be compiled on Panther against the 10.3 SDK or on 10.2 against the Jaguar SDK.
If we're *compiling* on Panther, we use the real constant, if we're compiling on Jaguar we substitute '19'.


So far I've found a dozen ways to handle RUNTIME conditional inclusion of things. I can use the appkit version numbers, gestalt, weak linking and/or availability macros to conditionally link function symbols. I know all about respondsToSelector: too. None of these fit.

What's frustrating me is I can't find a way to tell at COMPILE time which SDK the software is being compiled against.
I need to allow compilation on 10.2 or 10.3. Is there any way to ask "#ifdef PANTHER_OR_LATER" etc?


Just to be clear, I handle using the constant FOO at runtime later in the code, what I need is a macro that allows me to conditionally include the value kThemeResizeUpCursor in the code or not. It feels like this should be simple, but how can I do it?

AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

        (see you later space cowboy ...)

_______________________________________________
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


  • Follow-Ups:
    • Re: Determining which SDK I'm compiling against
      • From: Larry Fransson <email@hidden>
  • Prev by Date: All IBOutlet instance variables show 0x0 - they're not there?! XCode bug?
  • Next by Date: Re: Global hotkeys
  • Previous by thread: Re: All IBOutlet instance variables show 0x0 - they're not there?! XCode bug?
  • Next by thread: Re: Determining which SDK I'm compiling against
  • Index(es):
    • Date
    • Thread