• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: #if on SDK_NAME
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >#if on SDK_NAME (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: GDB problems and version
  • Next by Date: Re: GDB problems and version
  • Previous by thread: Re: #if on SDK_NAME
  • Next by thread: Re: #if on SDK_NAME
  • Index(es):
    • Date
    • Thread