|
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
|
▷ |