Re: Availability Macros, errors in cocoa headers?
Re: Availability Macros, errors in cocoa headers?
- Subject: Re: Availability Macros, errors in cocoa headers?
- From: Ricky Sharp <email@hidden>
- Date: Thu, 30 Dec 2004 18:08:48 -0600
On Dec 30, 2004, at 5:38 PM, Sean McBride wrote:
OK, I must be missing something simple. :)
I'm reading technote 2064 about Availability Macros. It says "One
common
usage of these macros would be to temporarily set
MAC_OS_X_VERSION_MAX_ALLOWED to be equal to
MAC_OS_X_VERSION_MIN_REQUIRED
and rebuild one's application to see which APIs are being used that are
not present in the minimum required OS version (compilation will
produce
errors for each usage of the now suddenly unavailable routines)".
So I tried adding the following to my prefix header, before including
Cocoa:
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_2
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_2
Instead, I tried putting "-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -
DMAC_OS_X_VERSION_MAX_ALLOWED=1020" in "Other C Flags".
Either way, I get compile errors *in the cocoa headers*. The first is:
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:184:
error: parse error before "animationEffect"
I can repro this with a fresh project. 10.3.7, XCode 1.5. The header
indeed looks in error to me.
Also reproduced it here (10.3.7, Xcode 1.5). The animationEffect param
is of type NSAnimationEffect. But that type is only defined if
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3.
Definitely file a bug about this as there should be some mechanism in
place to allow Apple to add new types just as they do APIs (i.e. be
able to mark them with appropriate macros instead of #ifdef'ng them
out).
In my particular test, I also got errors in NSLayoutManager.h
(complained about missing protocol NSGlyphStorage and another parse
error before NSGlyphGenerator).
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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