Page tree

Compile a section of code if an identifier is defined.

Syntax

#ifdef <identifier>
  <statements...>
[#else]
  <statements...>
#endif

Arguments

NameDescription
<identifier><identifier> is the name of a definition whose existence is being verified.

Description

#ifdef...#endif lets you perform a conditional compilation. It does this by identifying a section of source code to be compiled if the specified <identifier> is defined.

The #else directive specifies the code to compile if <identifier> is undefined. The #endif terminates the conditional compilation block.