Mail Archives: djgpp/1996/08/07/08:46:49
Steven M. Gibson <76711 DOT 2621 AT CompuServe DOT COM> wrote:
>All:
>
>Does GCC have any target-dependent DEFINES? I'd like to assemble
>slightly different code under GCC/Unix than under GCC/PC ... and
>I'd like to not have to REMEMBER to set my own DEFINE to do so.
You can set target definition in two ways:
use the -A switch:
#if #cpu(i386)
char *cpu="intel 386";
#else
char *cpu="other";
#endif
c:\> gcc -Acpu(i386) xx.c
But you didn't want to specify your own define: Just use the -v switch:
C:\TMP>gcc -v a.c
Reading specs from c:/djgpp/lib\specs
gcc version 2.7.2
c:/djgpp/bin\cpp.exe -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=7
-Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2 -DDJGPP_MINOR=0 -D__unix__ -D__i386__
-D__GO32__ -D__MSDOS__ -D__DJGPP__=2 -D__DJGPP_MINOR__=0 -D__unix -D__i386
-D__GO32 -D__MSDOS -D__DJGPP=2 -D__DJGPP_MINOR=0 a.c c:/djgpp/tmp\ccbaaaaa
GNU CPP version 2.7.2 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
c:/djgpp/include
c:/djgpp/contrib/grx20/include
C:\TMP>
I think, you can find as many target defines as you need.
Helge
- Raw text -