English
Language : 

CC78K4 Datasheet, PDF (151/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 9 PREPROCESSING DIRECTIVES (COMPILER DIRECTIVES)
(7) #define( ) directive
Macro Replacement Directives
#define ( )
FUNCTION
The function-form #define directive which has the form:
#define name (name, ..., name) replacement list
replaces the identifier specified in the function format with a given replacement list (any character sequence that
does not contain a line feed). No white space is allowed between the first name and the opening parenthesis “(”.
This list of names (identifier list) may be empty. Because this form of the directive defines a macro, the macro
call will be replaced with the parameters of the macro inside the parentheses.
SYNTAX
#define identifier ( identifier list ) replacement-list line feed
EXAMPLE
#define F(n)
void main() {
int i;
i=F(2)
}
(n*n)
EXPLANATION
In the above example, #define directive will replace “F(2)” with “(2*2)” and thus the value of i will become 4. For
the sake of safety, be sure to enclose the replacement list in parentheses, because unlike a function definition,
this function-form macro is merely to replace a sequence of characters.
User’s Manual U15556EJ1V0UM
151