#define
Macro
Definition
with
Arguments
#define
Syntax
#define
<name>
(arg,
...
,arg)
<token-string>
Description
Subsequent occurrences
of
name
followed
immediately
by
a list
of
argu-
Example
C-2
ments separated
by
commas and enclosed in parentheses
are
replaced
by
token-string, where each occurrence
of
an
argument
is
replaced
by
the
corresponding set
of
tokens from the comma-separated ,string. When a
macro
with
arguments is expanded, the arguments are placed
into
the ex-
panded token-string unchanged. After the entire token-string has been ex-
panded,
GSPCPP scans again
for
names
to
expand
atthe
beginning'
of
the
newly
created token-string,
which
allows for' nested macros. '
Note that there
is
no space between name and the open parenthesis at the
beginning
of
the argument list.
AI~o;
there
is
no trailing semicolon (;).
#define
f(a,b,c)
3*a+b-c
causes
f(27,begin,minus)
whenever it occurs in the code,
to
be expanded
to
3*27+begin-minus