I want the MSK_LOGD(1) to get converted to PRINT_0 but It is getting converted to PRINT_COUNT_ARGS(1)(1)
Can you suggest the changes to get the required output
#define PRINT_0 printf("zero");
#define COUNT_ARGS(...) COUNT_ARGS_UPTO_3(__VA_ARGS__, 3, 2, 1, 0)
#define COUNT_ARGS_UPTO_3(a, b, c, d, count, ...) count
#define PRINT(n, ...) PRINT_##n(__VA_ARGS__)
#define MSK_LOGD(...) PRINT(COUNT_ARGS(__VA_ARGS__), __VA_ARGS__)
int main(void)
{
MSK_LOGD(1)
return (0);
}