• 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 SDK version during preprocessing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining SDK version during preprocessing


  • Subject: Determining SDK version during preprocessing
  • From: Matt Gough <email@hidden>
  • Date: Fri, 20 Jan 2006 16:17:43 +0000

What is the best way to determine the SDK version being used?

E.g I would like to say something like this:

#if SDK_VERSION >= 4
        MachineLocation.u.dls.Delta = isDLS? 0x80: 0x00;
#else
	// Using an older SDK so u.dls is not available.
        MachineLocation.u.dlsDelta = isDLS? 0x80: 0x00;
#endif

In the old days, it used to be possible to test UNIVERSAL_INTERFACES_VERSION, but that has been stuck at 0x400 for all of OS X's lifetime.

All my searching through ConditionalMacros, TargetConditionals and AvailabilityMacros didn't turn up anything usable.

Obviously I could define my own preprocessor macro, but I'd really like my code to be dropped into any existing project without having to manually define that flag (and keep it up to date if the SDK actually changes).

Matt Gough
_______________________________________________
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: Determining SDK version during preprocessing
      • From: Finlay Dobbie <email@hidden>
  • Prev by Date: RE: Only Link In Essential Symbols
  • Next by Date: Re: #pragma message(). Was 'AliasRecord'...
  • Previous by thread: Re:Exception on a simple arithmetic problem
  • Next by thread: Re: Determining SDK version during preprocessing
  • Index(es):
    • Date
    • Thread