The compiler defines several macros at startup:
__CC65__
This macro is always defined. Its value is the version number of the compiler in hex. Version 2.0.1 of the compiler will have this macro defined as 0x0201.
__APPLE2__
This macro is defined if the target is the Apple ][ (-t apple2).
__ATARI__
This macro is defined if the target is one of the Atari computers (400/800/130XL/800XL).
__ATMOS__
This macro is defined if the target is the Oric Atmos (-t atmos).
__CBM__
This macro is defined if the target system is one of the CBM targets.
__C16__
This macro is defined if the target is the c16 (-t c16).
__C64__
This macro is defined if the target is the c64 (-t c64).
__C128__
This macro is defined if the target is the c128 (-t c128).
__PLUS4__
This macro is defined if the target is the plus/4 (-t plus4).
__CBM510__
This macro is defined if the target is the CBM 500 series of computers.
__CBM610__
This macro is defined if the target is one of the CBM 600/700 family of computers (called B series in the US).
__PET__
This macro is defined if the target is the PET family of computers (-t pet).
__GEOS__
This macro is defined if you are compiling for the GEOS system (-t geos).
__FILE__
This macro expands to a string containing the name of the C source file.
__LINE__
This macro expands to the current line number.
__STRICT_ANSI__
This macro is defined to 1 if the -A
compiler option was given, and
undefined otherwise.
__OPT__
Is defined if the compiler was called with the -O
command line option.
__OPT_i__
Is defined if the compiler was called with the -Oi
command line option.
__OPT_r__
Is defined if the compiler was called with the -Or
command line option.
__OPT_s__
Is defined if the compiler was called with the -Os
command line option.