• 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: Built-in gcc defines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Built-in gcc defines


  • Subject: Re: Built-in gcc defines
  • From: Alexander von Below <email@hidden>
  • Date: Mon, 21 Aug 2006 16:03:15 +0200


On 21.08.2006, at 15:55, TuskenTower wrote:

>> Or
>> gcc -dM -E -x c - <<<''
>
> Or (from a colleague of mine)
>
> :| gcc -dM -E -x c -

Ooh nice. I didn't know about :.


One more option for the list: cpp -dM - < /dev/null

Thanks for all the cool options!

To add what I have learned,

 :| gcc -arch ppc -dM -E -x c -

and

 :| gcc -arch i386 -dM -E -x c -

do what you would expect, i.e. spit out the defines you have and don't have on those platforms. Here are the ones that I am interested in:

#define __APPLE__ 1
 So that I know that the code is being compiled on a Mac

#define __LITTLE_ENDIAN__ 1
 Defined for Intel

#define __BIG_ENDIAN__ 1
 Defined for PPC

Furthermore there are:

#define i386 1
#define __i386 1
#define __i386__ 1

and

#define __ppc__ 1
#define _ARCH_PPC 1

Which can be useful, too. Although if you want to know the endianess, you should actually check the endianess, and not make assumptions based on the chip.

Thanks a lot!

Alex
_______________________________________________
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: 
 >Built-in gcc defines (From: Alexander von Below <email@hidden>)
 >Re: Built-in gcc defines (From: Rick Altherr <email@hidden>)
 >Re: Built-in gcc defines (From: Steve Checkoway <email@hidden>)
 >Re: Built-in gcc defines (From: Jonas Maebe <email@hidden>)
 >Re: Built-in gcc defines (From: Steve Checkoway <email@hidden>)
 >Re: Built-in gcc defines (From: TuskenTower <email@hidden>)

  • Prev by Date: Re: Built-in gcc defines
  • Next by Date: isnan - isnand function definition changes
  • Previous by thread: Re: Built-in gcc defines
  • Next by thread: How Make an Automator Action Target (like CoreRecipes example)
  • Index(es):
    • Date
    • Thread