C Macros: How to map another macro to variadic arguments?

Viewed 2029

I'd like to know how to apply a unary function (or another macro) to variadic arguments of a macro, like

int f(int a);

#define apply(args...) <the magic>
apply(a, b, c)

which unrolls

f(a)
f(b)
f(c)

Note that the number of arguments is unknown.

3 Answers
Related