In gcc, it appears that referencing the results of a macro expansion later inside that same expansion doesn't work. For example:
#define TESTMACRO(name) \
static int name##_func(int solNo) { \
return (solNo); \
}\
static int name##Thing = {0,##name##_func},NULL,{"", capInvSw##name}};
TESTMACRO(stuff)
This results in errors like this:
test.c:7:29: error: pasting "," and "stuff" does not give a valid preprocessing token
static int name##Thing = {0,##name##_func},NULL,{"", capInvSw##name`}};
^
test.c:9:1: note: in expansion of macro ‘TESTMACRO’
TESTMACRO(stuff)
I would expect to have a function called stuff_func created and passed into stuffThing. I believe that this works in other compilers. What is the equivalent way to do this in gcc?