This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define PRINT(...) CAT(CT(__VA_ARGS__))(__VA_ARGS__) | |
#define CAT(N) DOG(N) | |
#define DOG(N) PRINT ## N | |
/* max supported args is 5 for now */ | |
#define CT(...) VALS(__VA_ARGS__, 5, 4, 3, 2, 1) | |
#define VALS(N1, N2, N3, N4, N5, N, ...) N |