• 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: Chris Espinosa <email@hidden>
  • Date: Thu, 16 Jul 2009 09:47:23 -0700

On Jul 15, 2009, at 3:23 PM, Jeremy Pereira wrote:
On 14 Jul 2009, at 23:45, Eric Gorr wrote:


So, I tried putting this in my code:

#if SDK_NAME == macosx10.5
SInt16 vwForkRef = 0;
#elif
FSIORefNum vwForkRef = 0;
#endif

However, I get the compile error:

error: missing binary operator before token ".5"

Notwithstanding all the other issues people have brought up, the above preprocessor directive does not have valid syntax. Judging from the error message, macosx10.5 has been parsed as two tokens "macosx10" and ".5" and the compiler is understandably complaining that you have no operator between them.

The values of the AvailabilityMacros definitions are in the form 1040, 1050 etc. for exactly this reason, which is yet another reason to use the provided and supported mechanism instead of rolling your own solution.


Chris
_______________________________________________
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


  • Follow-Ups:
    • Re: #if on SDK_NAME
      • From: Chris Suter <email@hidden>
References: 
 >#if on SDK_NAME (From: Eric Gorr <email@hidden>)
 >Re: #if on SDK_NAME (From: Jeremy Pereira <email@hidden>)

  • Prev by Date: Re: GDB & static const variables
  • Next by Date: Re: GDB & static const variables
  • Previous by thread: Re: #if on SDK_NAME
  • Next by thread: Re: #if on SDK_NAME
  • Index(es):
    • Date
    • Thread