#define FIRST(a, ...) a #define SECOND(a, b, ...) b #define IS_PROBE(...) SECOND(__VA_ARGS__, 0) #define PROBE() ~, 1 #define CAT(a,b) a ## b #define NOT(x) IS_PROBE(CAT(_NOT_, x)) #define _NOT_0 PROBE() #define BOOL(x) NOT(NOT(x)) #define HAS_ARGS(...) BOOL(FIRST(_END_OF_ARGUMENTS_ __VA_ARGS__)()) #define _END_OF_ARGUMENTS_() 0 No args: HAS_ARGS() One arg: HAS_ARGS(0) Two args: HAS_ARGS(0, 2) Three args: HAS_ARGS(0, 1, 2)