Re: Built-in gcc defines
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