English
Language : 

CC78K4 Datasheet, PDF (139/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 9 PREPROCESSING DIRECTIVES (COMPILER DIRECTIVES)
(2) #elif directive
Conditional Translation Directives
#elif
FUNCTION
The #elif directive normally follows the #if directive. If the value of the constant expression of the #if directive is
0, the constant expression of the #elif directive is evaluated. If the constant expression of the #elif directive is 0,
the translation phase of C will skip (discard) the statements (a section of source code) between #elif and #endif.
SYNTAX
#elif constant-expression line feed group
EXAMPLE
#if FLAG == 0
:
#elif FLAG != 0
:
#endif
EXPLANATION
In the above example, the constant expression “FLAG= =0” or “FLAG!=0” is evaluated to determine whether a
set of statements that follow #if and another set of statements that follow #elif is to be used in the translation
phase. If the value of “FLAG” is zero, the source code between #if and #elif will be translated. If the value is
nonzero, the source code between #elif and #endif will be translated.
User’s Manual U15556EJ1V0UM
139