English
Language : 

CC78K0S Datasheet, PDF (144/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 9 PREPROCESSING DIRECTIVES (COMPILER DIRECTIVES)
(2) #elif directive
Conditional Inclusion
#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 new-line 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 are 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.
144
User’s Manual U14872EJ1V0UM