Re: Availability Macros, errors in cocoa headers?
Re: Availability Macros, errors in cocoa headers?
- Subject: Re: Availability Macros, errors in cocoa headers?
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 31 Dec 2004 10:16:02 -0500
> On Thursday, December 30, 2004, at 11:40PM, Sean McBride <email@hidden>
> wrote:
>
>> Ricky Sharp (email@hidden) on Thu, Dec 30, 2004 07:08 PM said:
>>
>>> 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.
>>
>> Thanks for confirming my sanity :)
>>
>>> Definitely file a bug about this as there should be some mechanism in
>>
>> <rdar://3936074>
>>
>> Well, at least things compile with -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -
>> DMAC_OS_X_VERSION_MAX_ALLOWED=1030.
>>
>> But I still can't get my app to launch on 10.2. :( I use several 10.3-
>> only things (bindings notably) but would like to at least get to main()
>> on 10.2 then bring up a Carbon alert. I'm willing to forget about 10.0
>> and 10.1.
I didn't see the beginning of this thread, so I may be answering a question
that wasn't asked.
You can overcome problems created when Apple omits availability macros from
functions in headers, simply by re-declaring them in your own headers with
the required availability macros.
For example, when building an accessibility app in Panther that also has to
run in Jaguar without the new Panther feature, I include the following
before my @interface directive:
extern AXError AXUIElementCopyParameterizedAttributeNames (AXUIElementRef
element, CFArrayRef *names) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
I also have to wrap the function call in an if block like so:
if ( AXUIElementCopyParameterizedAttributeNames ) {
// function is available on this system
// so call the function here
}
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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