3.6. Predefined macros

Table 3.9 lists the macro names predefined by the ARM C and C++ compilers. Where the value field is empty, the symbol concerned is merely defined, as though by (for example) -D__arm on the command line.

Table 3.9. Predefined macros

NameValueNotes
__STDC__1defined in all compiler modes except PCC mode
__cplusplus1defined in C++ compiler mode
__CFRONT_LIKE1defined in -cfront compiler mode
__arm defined if using armcc, tcc, armcpp , or tcpp
__thumb defined if using tcc or tcpp
__SOFTFP__ defined if compiling to use the software floating-point library (-apcs /softfp)
__APCS_NOSWST defined if -apcs /noswst in use
__APCS_REENT defined if -apcs /reent in use
__APCS_INTERWORK defined if -apcs /interwork in use
__APCS_32 defined unless -apcs /26bit is in use
__APCS_NOFP defined if -apcs /nofp in use (no frame pointer)
__APCS_FPREGARGS defined if -apcs /fpregargs is in use
__BIG_ENDIAN defined if compiling for a big-endian target
__DIALECT_FUSSY defined if -fussy is specified.
__DIALECT_PCC defined if -pcc is specified.
__TARGET_ARCH_xx xx represents the target architecture. The value of xx depends on the target architecture. For example, if the compiler options -arch 4T or -cpu ARM7TDMI are specified then __TARGET_ARCH_4T is defined, and no other symbol starting with _TARGET_ARCH_ is defined.
__TARGET_CPU_xx 

xx represents the target cpu. The value of xx is derived from the -processor compiler option, or the default if none is specified. For example, if the compiler option -processor ARM7TM is specified then _TARGET_CPU_ARM7TM is defined and no other symbol starting with _TARGET_CPU_ is defined.

If the target architecture only is specified, without a target CPU then _TARGET_CPU_generic is defined.

If the processor name contains hyphen (-) characters, these are mapped to an underscore (_). For example, -processor SA-110 is mapped to __TARGET_CPU_SA_110.

__TARGET_FEATURE_HALFWORD defined if the target architecture supports halfword and signed byte access instructions.
__TARGET_FEATURE_MULTIPLY defined if the target architecture supports the long multiply instructions MULL and MULAL.
__TARGET_FEATURE_THUMB defined if the target architecture is Thumb-aware.
__ARMCC_VERSION Gives the version number of the compiler. The value is the same for armcc and tcc; it is a decimal number, whose value can be relied on to increase monotonically between releases.
__CLK_TCK100centisecond clock definition
__sizeof_int4sizeof(int), but available in preprocessor expressions
__sizeof_long4sizeof(long), but available in preprocessor expressions
__sizeof_ptr4sizeof(void *), but available in preprocessor expressions
__FILE__ the presumed full pathname of the current source file
__MODULE__ contains the filename part of the value of __FILE__
__LINE__ the line number of the current source file
__DATE__ the date of translation of the source file
__TIME__ the time of translation of the source file
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C