Hi

I am trying to have macros with a variable number of arguments (with the Metrowerks SDK for 6600).

In the web I found how to do that. Actually, there are two different versions:

#define MYMACRO(...) do_something(__VA_ARGS__)

and

#define MYMACRO(args...) do_something(args)

From what I experienced it seems that MWCC likes version 1 and GCC likes version 2. So there is a dilemma when you want to compile with MWCC for the emulator and GCC for the actual device builds. I have tried and use

#ifdef __WINSCW__
#define MYMACRO(...) do_something(__VA_ARGS__)
#else
#define MYMACRO(args...) do_something(args)
#endif

but that does not seem to do the trick when building the makefiles (probably because cpp.exe is used for preparing the makefiles). Does anyone have a suggestion on how to do that?

any help would be highly appreciated