f78 The #if Directive Contents|Index|Previous|Next
 

The #if directive 

The #if directive in its simplest form consists of the following statement.

The comment following #endif is not required, but it is a good practice because it helps people match the #endif to the corresponding #if. Such comments should always be used, except in short conditionals that are not nested. In fact, you can put anything at all after the #endif and it will be ignored by the GNU C preprocessor, but only comments are acceptable in ANSI Standard C. expression is a C expression of integer type, subject to stringent restrictions. It may contain the following.
Note:

sizeof operators and enum-type values are not allowed. enum-type values, like all other identifiers that are not taken as macro calls and expanded, are treated as zero.

The controlled text inside of a conditional can include preprocessing directives. Then the directives inside the conditional are obeyed only if that branch of the conditional succeeds. The text can also contain other conditional groups. However, the #if and #endif directives must balance. 0