Skip navigation.
 
mlRe: Availability Macros, errors in cocoa headers?
FROM : Bill Cheeseman
DATE : Fri Dec 31 16:16:02 2004

> On Thursday, December 30, 2004, at 11:40PM, Sean McBride <<email_removed>>
> wrote:
>

>> Ricky Sharp (<email_removed>) 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_removed>
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

Related mailsAuthorDate
mlAvailability Macros, errors in cocoa headers? Sean McBride Dec 31, 00:38
mlRe: Availability Macros, errors in cocoa headers? Ricky Sharp Dec 31, 01:08
mlRe: Availability Macros, errors in cocoa headers? Sean McBride Dec 31, 06:40
mlRe: Availability Macros, errors in cocoa headers? Ricky Sharp Dec 31, 13:30
mlRe: Availability Macros, errors in cocoa headers? glenn andreas Dec 31, 16:11
mlRe: Availability Macros, errors in cocoa headers? Bill Cheeseman Dec 31, 16:16
mlRe: Availability Macros, errors in cocoa headers? Nick Zitzmann Dec 31, 17:50