.TH #elif "" "" "Preprocessing Directive" "" "(Language/preprocessing/conditional inclusion)"
.II "include code conditionally"
.PC "Include code conditionally"
.PP
The preprocessing directive
.B #elif
conditionally includes code within a program.
It can be used after any of the instructions
.BR #if ,
.BR #ifdef ,
or
.BR #ifndef .
.PP
If the conditional expression of the preceding
.BR #if ,
.BR #ifdef ,
or
.B #ifndef
directive is false (i.e., evalutates to zero)
and if the current condition is true (i.e., evaluates to a value
other than zero), then
.I group
is included within the program,
up to the next
.BR #elif ,
.BR #else ,
or
.B #endif
directive.
An
.BR #if ,
.BR #ifdef ,
or
.B #ifndef
directive may be followed by any number of
.B #elif
directives.
.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.
.if \nX=4 \{\
Note that the implementation defines whether the result of evaluating
a character constant in
.I "constant-expression"
matches the result of evaluating the same character constant in a C expression;
for example, it is up to the implementation whether
.DM
	#elif 'z' - 'a' == 25
.DE
.PP
yields the same result as:
.DM
	else if ('z' - 'a' == 25)
.DE \}
.SH "See Also"
.Xr "#else," _23else
.Xr "#endif," _23endif
.Xr "#if," _23if
.Xr "#ifdef," _23ifdef
.Xr "#ifndef," _23ifndef
.Xr "C preprocessor," c_preproc
.Xr "defined" defined
.br
\*(AS, \(sc6.8.1
