• 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: iPhone Platform Compiler Symbol?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone Platform Compiler Symbol?


  • Subject: Re: iPhone Platform Compiler Symbol?
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 14 May 2009 16:58:06 -0700

On May 14, 2009, at 4:16 PM, Peter O'Gorman wrote:

Philip Aker wrote:
On 2009-05-14, at 12:40:57, Michael Crawford wrote:

"man gcc" documents the following, which will list out *all* the
predefinied symbols:

touch foo.h; cpp -dM foo.h

# cpp -dM < /dev/null

saves some typing.

Although Chris has answered with the right way to check if building for
iPhoneOS, you can get a list of the predefined macros with:


/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch arm
-dM -E -x c /dev/null

(to check languages other than C, change the -x c to, e.g. -x
objective-c, -x c++, -x objective-c++ etc)

You really want to go by the symbols that are published in Availability.h, which defines the supported Apple platforms.


What the compiler says may differ from compiler to compiler, and will be sufficiently generic that you don't want to use it except when you really know what you're doing.

For example, you don't want to infer that __ARM__ == iPhone, because that leaves out the Simulator.

I'm going to say this one last time:

Availability.h

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


References: 
 >iPhone Platform Compiler Symbol? (From: "K. Chen" <email@hidden>)
 >Re: iPhone Platform Compiler Symbol? (From: Chris Espinosa <email@hidden>)
 >Re: iPhone Platform Compiler Symbol? (From: Michael Crawford <email@hidden>)
 >Re: iPhone Platform Compiler Symbol? (From: Philip Aker <email@hidden>)
 >Re: iPhone Platform Compiler Symbol? (From: Peter O'Gorman <email@hidden>)

  • Prev by Date: Re: iPhone Platform Compiler Symbol?
  • Next by Date: Switching from Simulator to Device
  • Previous by thread: Re: iPhone Platform Compiler Symbol?
  • Next by thread: Re: iPhone Platform Compiler Symbol?
  • Index(es):
    • Date
    • Thread