.TH #ifdef "" "" "Preprocessing Directive" "" "(Language/preprocessing/conditional inclusion)"
.II "code, include code conditionally"
.II "include code conditionally"
.PC "Include code conditionally"
.PP
The preprocessing directive
.B #ifdef
checks whether
.I identifier
has been defined as a macro name.
If
.I identifier
has been defined as a macro, then the preprocessor includes
.I group
within the program, up to the next
.BR #elif ,
.BR #else ,
or
.B #endif
directive.
If
.I identifier
has not been defined, however, then
.I group
is skipped.
.PP
An
.B #ifdef
directive can be followed by any number of
.B #elif
directives, by one
.B #else
directive, and must be followed by an
.B #endif
directive.
.SH Example
For an example of using this directive in a program, see
.BR assert .
.SH "See Also"
.Xr "#elif," _23elif
.Xr "#else," _23else
.Xr "#endif," _23endif
.Xr "#if," _23if
.Xr "#ifndef," _23ifndef
.Xr "C preprocessor," c_preproc
.Xr "defined" defined
.br
\*(AS, \(sc6.8.1
