Re: #if on SDK_NAME
Re: #if on SDK_NAME
- Subject: Re: #if on SDK_NAME
- From: "Sean McBride" <email@hidden>
- Date: Wed, 15 Jul 2009 12:07:17 -0400
- Organization: Rogue Research Inc.
On 7/14/09 6:45 PM, Eric Gorr said:
>#if SDK_NAME == macosx10.5
> SInt16 vwForkRef = 0;
>#elif
> FSIORefNum vwForkRef = 0;
>#endif
I had that exact situation. In my prefix header I added a check for old
SDKs, then just typedef'ed FSIORefNum the same way the 10.5 SDK does. So:
#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1050)
#if __LP64__
typedef int FSIORefNum;
#else
typedef SInt16 FSIORefNum;
#endif /* __LP64__ */
#endif
Then I just use the newer FSIORefNum everywhere, and have only one ugly #if.
(I think some of the other repliers are confused about what you are
trying to do. I suspect you are writing library code, and in that case
you often need these kinds of #ifs to support multiple SDK versions.)
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden