可能重复:
How can I use macro as one of other macro parameters list
#define SUM(a, b, c) (a+b+c)
#define DUPLICATE(a) a, a
int result = SUM(1, DUPLICATE(2)); // equivalent to SUM(1, 2, 2)
我收到了这个警告:
warning C4003: not enough actual parameters for macro 'SUM'
如何避免此警告并将SUM(1, DUPLICATE(2))
扩展为SUM(1, 2, 2)
?