On Visual Studio 2005 I have a macro that looks like this (examplified!!):
#define MY_CALL(FUN, ...) \
if(prepare(x, y)) { \
FUN(__VA_ARGS__); \
}
/**/
As long as the function takes at least one argument, I'm fine.
When the function takes zero arguments, the preprocessor "helpfully" removes the "trailing comma", expanding something like this:
if(prepare(x y)) { funct(); }
Great, isn't it?
How can I fix this macro, so that it'll work with zero __VA_ARGS__
on Visual C++ (VS 2005)?
Apparently this is a bug in VS2005.