I want to do something like:
#define TYPE uint32_t
#define ADDSUFFIX(x) xTHETYPE
THETYPE * ADDSUFFIX(getvalue) (THETYPE * pMem) {}
And I need to get uint32_t getvalueuint32_t (uint32_t * pMem) {} depends on what TYPE is.
How to make this work ?
You want the “token pasting” operator, but it can get tricky when one of the operands is a parameter or a macro. This worked for me:
If you want getvalue_uint32_t, this works:
Also consider: