Directive #if


Directive #if

#if

Description

The #if directive can evaluate simple expressions and, if the expression is evaluates to true, "activate" the code block that follows. The code block ends when an #endif, #else, #elseif or #elif block is encountered at the same nesting depth.

The #if expressions may include defines, integer, string and float constants, ?:, || and && operations, ~, ^, !, | and & operations, <, >, <=, >=, == and != operations, +, -, *, /, << and >> operations and paranthesis.

Strings may also be indexed with the [] index operator. Finally there are three special "functions" available in #if expressions; defined(), efun() and constant().

See also

#ifdef, #ifndef, #elif, #else, #endif, defined(), constant(), efun()