.TH #if "" "" "Preprocessing Directive" "" "(Language/preprocessing/conditional inclusion)"
.II "code, include conditionally"
.II "include code conditionally"
.PC "Include code conditionally"
.PP
The preprocessing directive
.B #if
tells the preprocessor that if
.I constant-expression
is true (i.e., that it evalutes to a value other than zero),
then include the following lines of code within the program
until it reads the next
.BR #elif ,
.BR #else ,
or
.B #endif
directive.
.PP
The
.I "constant-expression"
must be an integral expression, and it cannot include a
.B sizeof
operator, a cast, or an enumeration constant.
All macro substitutions are performed upon the
.I "constant-expression"
before it is evaluated.
All integer constants are treated as
long objects, and are then evaluated.
If
.I "constant-expression"
includes character constants, all escape sequences are converted into
characters before evaluation.
.PP
If
.I "constant-expression"
is an undefined symbol, the preprocessor treats it
the same as it would a false statement.
.SH "See Also"
.Xr "#elif," _23elif
.Xr "#else," _23else
.Xr "#endif," _23endif
.Xr "#ifdef," _23ifdef
.Xr "#ifndef," _23ifndef
.Xr "C preprocessor," c_preproc
.Xr "defined" defined
.br
\*(AS, \(sc6.8.1
