I'm doing something like below:
#define AA(mac, a, ...) mac(a, __VA_ARGS__)
#define MAC1(a, b, c) a##b##c
AA(MAC1, 0, 1, 2)
what I really want is to translate "AA(MAC1, 0, 1, 2)" to "012", but I get "01,2", which is reasonalbe though, but not I want.
Edit: A work around is to remove the VA_ARGS, and define a AA like
#define AA(mac,a,b,c,d,e,f,g,h,...) mac(a,b,c,d,e,f,g,h)
#define MAC1(a, b, c) a##b##c
AA(MAC1, 0, 1, 2)
gives what I what, "012", I don't know why though.
Your initial code:
seems to work fine:
So, maybe there's an issue with your compiler or IDE.