Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining SDK version during preprocessing



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:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.