1#define COUNT(...) COUNT_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
2#define COUNT_HELPER(N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N, ...) N
4#define DEBUGVALN(N) DEBUGVALN_HELPER(N)
5#define DEBUGVALN_HELPER(N) DEBUGVAL##N
7#define DEBUGVAL10(x, ...) \
9 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
10 DEBUGVAL9(__VA_ARGS__); \
12#define DEBUGVAL9(x, ...) \
14 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
15 DEBUGVAL8(__VA_ARGS__); \
17#define DEBUGVAL8(x, ...) \
19 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
20 DEBUGVAL7(__VA_ARGS__); \
22#define DEBUGVAL7(x, ...) \
24 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
25 DEBUGVAL6(__VA_ARGS__); \
27#define DEBUGVAL6(x, ...) \
29 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
30 DEBUGVAL5(__VA_ARGS__); \
32#define DEBUGVAL5(x, ...) \
34 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
35 DEBUGVAL4(__VA_ARGS__); \
37#define DEBUGVAL4(x, ...) \
39 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
40 DEBUGVAL3(__VA_ARGS__); \
42#define DEBUGVAL3(x, ...) \
44 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
45 DEBUGVAL2(__VA_ARGS__); \
47#define DEBUGVAL2(x, ...) \
49 DEBUG_OUT << NAMEDVALUE(x) << ", "; \
50 DEBUGVAL1(__VA_ARGS__); \
54 DEBUG_OUT << NAMEDVALUE(x) << DEBUG_ENDL; \