NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
Conditional Compilation

Conditional compilation works similar to the C preprocessor's conditional compilation.

The following preprocessor directives may be used:

DirectiveMeaning
#ifdef symbolIf symbol is defined then compile the following code
#ifndef symbolIf symbol is not defined then compile the following code
#elseSwitch from compiling to not compiling and vice versa
#endifReturn to previous compiling state
#if conditionIf the condition evaluates to true then compile the following code
#elifSame as #else but used with #if
Table 7. Conditional compilation directives

See the NXTDefs.h and NXCDefs.h header files for many examples of how to use conditional compilation.