Replacement text is the source token sequence stored by a macro definition. When a function-like macro is invoked, preprocessing copies this sequence and substitutes each parameter with the corresponding expanded argument. section 17.1
A replacement text with parameters
In `#define MINSIZE(X, Y) (sizeof(X)<sizeof(Y) ? sizeof(X) : sizeof(Y))`, the expression after the parameter list is the replacement text. An invocation such as `MINSIZE(redA, B)` substitutes the expanded arguments for `X` and `Y`, producing a larger expression that computes the smaller size. section 17.1
Function-like macro expansion processes replacement text through these steps:
- Temporarily disable the macro to prevent infinite recursion. section 17.1
- Parse the invocation arguments, using commas outside nested parentheses as separators. section 17.1
- Recursively expand macros appearing in the arguments, then substitute the resulting fragments into a copy of the replacement text. section 17.1
#define BYTECOPY(T, S) memcpy(&(T), &(S), MINSIZE(T, S))
Inspect a replacement text that combines parameter substitution with `memcpy` and another macro invocation. section 17.1
