Hi.
I want whatever string is passed as the name parameter to be substituted in two longer identifiers, i.e. if I pass Horticulture for name, I should get back kCommandInfo_Ho rticulture and Cmd_Horticultur e_Execute.
Seems the preprocessor requires space before and after a token, of course.
The stringizing and token-pasting operators don't appear to help here.
Is there a way to get the preprocessor to insert a passed token into a longer identifier?
Thanks.
Code:
#define DEFINE_COMMAND(name, description, refRequired, numParams, paramInfo) \
kCommandInfo_name = { \
#name, \
"", \
0, \
#description, \
refRequired, \
numParams, \
paramInfo, \
HANDLER(Cmd_name_Execute), \
Cmd_Default_Parse, \
NULL, \
0 \
};
Seems the preprocessor requires space before and after a token, of course.
The stringizing and token-pasting operators don't appear to help here.
Is there a way to get the preprocessor to insert a passed token into a longer identifier?
Thanks.
Comment