The following (test with gcc -E blah.c):
gcc -E blah.c
#define UNUSED(type) type UNUSED_ ## __COUNTER__ UNUSED(char const *) UNUSED(int)
Generat
I believe you must "double expand" it:
#define STR(x) #x #define UNUSED(type) type UNUSED_ ## STR(__COUNTER__) UNUSED(char const *) UNUSED(int)