two layers call for __VA_ARGS__ in VS 2008 failed

85 Views Asked by At

I use VA_ARGS for the following case:

#define CHECK4(x,y,...) if ((x)) { y(__VA_ARGS__); }
#define CHECK5(x,y,...) if ((x)) { y(__VA_ARGS__); }

Then call it:

CHECK5(1, CHECK4,1,printf, "here %s %s %s", "are", "some", "varargs2(4)\n");

In vs 2008, it failed for CHECK5 calling, but using gcc it works well. How should I let it work in VS 2008?

1

There are 1 best solutions below

0
On
CHECK5(1, CHECK4(1,printf, "here %s %s %s", "are", "some", "varargs2(4)\n"), 1);