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: FSIORefNum with 10.4u SDK?



On Wed, May 28, 2008 at 1:02 PM, kwiley <email@hidden> wrote:
> I wrote my whole project with a configuration that only built for i386.  I
> then added ppc to the architecture list, switched the root SDK from 10.5 to
> 10.4u, and now I'm getting a few errors (of course).  One concerns
> FSIORefNum, as in the following code:
>
> FSIORefNum forkRefNum;
> status = FSOpenFork (
>        &tFSRef,
>        dataForkName.length,
>        dataForkName.unicode,
>        fsRdPerm,
>        &forkRefNum
>        );
>
> The error is: 'FSIORefNum' was not declared in this scope.  The prefix
> header includes Carbon/Carbon.h. I'm not sure what else to do.

FSIORefNum was introduced in 10.5. In 10.4, the final parameter to
FSOpenFork was an SInt16. Assuming that this code won't be used in a
64-bit application, you're safe just using SInt16 instead of
FSIORefNum (the latter is just a typedef for the former in 32-bit
configurations).

> On a related note, when building for both i386 and ppc (this is, by
> definition, a Universal app, correct?) is the correct approach what I did,
> i.e., to switch the root SDK from 10.5 to 10.4u?

That depends on what you're trying to accomplish.

If you just want to build an app that runs on 10.4, and doesn't take
advantage of any 10.5-specific API, then setting the SDK to 10.4u is
indeed appropriate.

If you want to build an app that runs on 10.4, but also takes
advantage of 10.5 API (when present), then you'll want to use the 10.5
SDK, but set your deployment target to 10.4. This will cause any 10.5
API to be weak linked (i.e. you can test the address of API functions
themselves against NULL before calling them)

If you don't care about running pre-10.4, then either set the SDK to
10.5 or to "Current Mac OS" (assuming that you're building on 10.5).

-- 
Clark S. Cox III
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >FSIORefNum with 10.4u SDK? (From: kwiley <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.