Directive #elseifndef


Directive #elifndef
Directive #elseifndef

#elifndef
#elseifndef

Description

These work as a combined #else and #ifndef without adding an extra level of nesting.

Example

The following two are equivalent:

#ifndef A
    // Code for not A.
  #else
  #ifndef B
    // Code for not B.
  #else
  #ifdef C
    // Code for not C.
  #else
    // Code for ABC.
  #endif
  #endif
  #endif

And

#ifndef A
    // Code for not A.
  #elifndef B
    // Code for not B.
  #elseifndef C
    // Code for not C.
  #else
    // Code for ABC.
  #endif
See also

#if, #ifdef, #else, defined(), constant()