Pre-processor conditionals will nest. For example, with:
#ifdef XYZZY
int a;
#ifdef PLUGH
int b;
#endif
int c;
#endif
The b
variable will exist only if both XYZZY
and PLUGH
are defined. The a
and c
variables depend only on XYZZY
.
From the C11 standard, section 6.10.1 Conditional inclusion /6
:
Each directive’s condition is checked in order. If it evaluates to false (zero), the group that it controls is skipped: directives are processed only through the name that determines the directive in order to keep track of the level of nested conditionals.
This "group" is the entire section, including all sub-groups. In the example given above, the XYZZY
group is everything between #ifdef XYZZY
and the corresponding #endif
.
SWE780
in the code you show. The code inside the inner#ifdef
(the second one) is kept in the program if and only of both the outer (first)#ifdef
and the inner#ifdef
are satisfied.