Preprocessor Defines

Revision as of 17:47, 13 April 2012 by Bfeher (Talk | contribs)

Jump to: navigation, search

MainPreprocessor Defines

The ROBOTC Compiler supports several different preprocessor defines that contain information about the compile time environment. Recently added are defines that indicate which features are enabled in the IDE.

The predefined symbols can be used in include files ad user programs for conditionally compiling code based on features. The preprocessor defines include:

Symbol Name Usage / Comments
ROBOTC Indicates that the ROBOTC compiler was used.
_DEBUG, _RELEASE, _CUSTOM Compiler optimization selection.
_TARGET Contains the type of debugger target. One of the following

values: “Robot”, “Emulator” or “VirtWorld”.

NXT, TETRIX, VEX, VEX20, ARDUINO The currently selected platform.
firmwareVersion Contains the numerical firmware version; e.g. 852.
IFI When IFI platform is selected.
TETRIX When TETRIX features are active.
FTC When FTC features are active.
Algebra When robot algebra option is enabled.
MultiRobotSupport When multi-robot option is enabled.

ROBOTC also supports the standard C preprocessor symbols below:

Symbol Name Usage / Comments
__FILE__ Current filename.
__LINE__ Current line number.
__DATE__ Date “mmm dd yyyy” of the current compilation.
__TIME__ Time “hh:mm:ss” of the current compilation.