The compiler defines several macros at startup:
__CC65__
This macro is always defined. Its value is the version number of the
compiler in hex. For example, version 2.10.1 of the compiler has this macro
defined as 0x02A1
.
__APPLE2__
This macro is defined if the target is the Apple ][ (-t apple2).
__APPLE2ENH__
This macro is defined if the target is the enhanced Apple // (-t apple2enh).
__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).
__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).
__GEOS__
This macro is defined if you are compiling for the GEOS system (-t geos).
__LUNIX__
This macro is defined if you are compiling for the LUnix system (-t lunix).
__LYNX__
This macro is defined if the target is the Atari Lynx (-t lynx).
__NES__
This macro is defined if the target is the NES (-t nes).
__PET__
This macro is defined if the target is the PET family of computers (-t pet).
__PLUS4__
This macro is defined if the target is the plus/4 (-t plus4).
__SUPERVISION__
This macro is defined if the target is the supervision (-t supervision).
__VIC20__
This macro is defined if the target is the vic20 (-t vic20).
__FILE__
This macro expands to a string containing the name of the C source file.
__LINE__
This macro expands to the current line number.
__CC65_STD__
This macro is defined to one of the following depending on the
--standard
command line option:
__CC65_STD_C89__
__CC65_STD_C99__
__CC65_STD_CC65__
__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.