Go to the previous, next section.
The C preprocessor normally has several predefined macros that vary between machines because their purpose is to indicate what type of system and machine is in use or being targetted. Some nonstandard predefined macros describe the operating system in use, with more or less specificity. For example, unix, BSD, mc68000. These predefined symbols are not only nonstandard, they are contrary to the ANSI standard because their names do not start with underscores.
GNU C offers a series of symbols for this purpose, whose names are made by
adding `__' at the beginning and end of the targetted machine
name specified with the `-b machine' switch. Thus, the
symbol __vax__
will be defined when the `-b vax'
switch is used.
__alpha__ |
DEC Alpha architecture. | |
__arc__ |
Argonaut ARC processor. | |
__amigaos__ |
AmigaOS. | |
__apple__ |
Apple Macintosh Mac OS. | |
__arm__ |
ARM-family processors. | |
__avr__ |
ATMEL AVR-family micro controllers. These are used in embedded applications. | |
__beos__ |
BeOS. | |
__blackfin__ |
The Blackfin processor, an Analog Devices DSP. | |
__bsd__ |
BSD. | |
__cris__ |
CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip series. These are used in embedded applications. | |
__crx__ |
The CRX CompactRISC architecture is a low-power 32-bit architecture with fast context switching and architectural extensibility features. | |
__dragonfly__ |
DragonFly. | |
__dos__ |
MSDOS, PCDOS, DRDOS. | |
__h8300__ |
Renesas H8/300 series of processors. | |
__i86__ |
Intel x86 processors. | |
__i286__ |
Intel i286 processor. | |
__i386__ |
Intel i386 processor. | |
__i486__ |
Intel i486 processor. | |
__i586__ |
Intel Pentium™ processor. | |
__iq2000__ |
Vitesse IQ2000 processors. These are used in embedded applications./TD> | |
__linux__ |
Linux. | |
__m32c__ |
Renesas M32C processor. This configuration is intended for embedded systems. | |
__m32r__ |
Renesas M32R processor. This configuration is intended for embedded systems. | |
__m6811__ |
Motorola 68HC11 family micro controllers. These are used in embedded applications. | |
__m6812__ |
Motorola 68HC12 family micro controllers. These are used in embedded applications. | |
__m68k__ |
Motorola M680x0 and ColdFire processors. | |
__m68000__ |
Motorola M68000 processor. | |
__m68010__ |
Motorola M68010 processor. | |
__m68020__ |
Motorola M68020 processor. | |
__m68030__ |
Motorola M68030 processor. | |
__m68040__ |
Motorola M68040 processor. | |
__m68060__ |
Motorola M68060 processor. | |
__macos__ |
Macintosh Max OS. | |
__mips__ |
MIPS system. | |
__ns32k__ |
National Semiconductor 320xx processors. | |
__os2__ |
IBM OS/2 | |
__powerpc__ |
PowerPC system. | |
__riscos__ |
RISC OS. | |
__s390__ |
S/390 system. | |
__sequent__ |
DYNIX/ptx. | |
__sparc__ |
Sun SPARC CPUs. | |
__sun__ |
Sun systems. | |
__sparc64__ |
64-bit Sun SPARC CPUs. | |
__unicos__ |
Cray UniCOS. | |
__unix__ |
UNIX or Unix-alike systems. | |
__vax__ |
DEC VAX. | |
__win32__ |
Microsoft Windows (32-bit) | |
__xtensa__ |
Embedded Xtensa systems |
Go to the previous, next section.