Mailing Lists: Apple Mailing Lists

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

Re: Availability Macros, errors in cocoa headers?



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

This email sent to email@hidden

References: 
 >Re: Availability Macros, errors in cocoa headers? (From: Ricky Sharp <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.