1

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?

Mat
  • 202,337
  • 40
  • 393
  • 406
  • 1
    This might be a duplicate; see [this question](http://stackoverflow.com/q/5134523/420683) and try to use the workaround described there. – dyp Dec 11 '13 at 12:00

1 Answers1

1
CHECK5(1, CHECK4(1,printf, "here %s %s %s", "are", "some", "varargs2(4)\n"), 1);
Nikita
  • 950
  • 8
  • 19