This is the mail archive of the
mailing list for the GCC project.
RE: which macro does gcc define beforehand ?
- From: "Martin York" <martin dot york at veritas dot com>
- To: <silverdaz at yahoo dot fr>,<gcc-help at gcc dot gnu dot org>
- Date: Thu, 2 Oct 2003 08:39:07 -0500
- Subject: RE: which macro does gcc define beforehand ?
Make sure file.c and/or file.cpp are empty (I now its metioned below but I think it is worth mentioning again) or you will also print any defines that are defined in these files.
I also just want to emphasis what is implied below. That the defines for 'gcc -E -dM file.c' and 'g++ -E -dM file.cpp' produces different outputs.
From: firstname.lastname@example.org [mailto:email@example.com]
Sent: Wednesday, October 01, 2003 6:19 PM
To: firstname.lastname@example.org; email@example.com
Subject: RE: which macro does gcc define beforehand ?
I believe GCC defines "sun" on Solaris. A nice easy trick to see what GCC defines by default is to touch a file (creating an empty one) and then run the following command:
gcc -c -E -dM file.c
g++ -c -E -dM file.cpp
where file.c and file.cpp are simply empty files. This will print out all the defines.
From: Daz [mailto:firstname.lastname@example.org]
Sent: Wednesday, October 01, 2003 4:14 PM
Subject: which macro does gcc define beforehand ?
I'm trying to find a macro for each platform I intend to use gcc.
On windows platform, _WIN32 is defined,
__APPLE__ or MACOSX are defined for the apple (powerpc) platforms.
I would like to find one macro for the solaris platform, which will be different than a linux one.
Basically, I'd like to do that
# define __MY_APP_PLATFORM_1__
# define __MY_APP_PLATFORM_2__
(It's somehow my way to "detect" which platform I'm running on.
If anyone has a better suggestion, feel free to tell me :) )
@ + Daz
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com