wrt: C preprocessor macro specialisation based on an argument
I am trying to use this technique to compare to 'void', however it also matches 'void *'.
Has anybody else seen this problem ? Is there a known solution ?
The source contains thousands of lines with preprocessor macros, so it is not easily readable. However it is like this:
#define GIVE_A_FUNCTION(RetType,Name,ArgType1)\
RetType Name(ArgType1 ArgName1) \
{ \
SWITCH_ON_VOID( \
RetType,\
,\
RetType value =)\
GetValue(); \
PostProcessing(); \
SWITCH_ON_VOID( \
RetType,\
,\
return value;)\
}
This expands to nothing if type is 'void *', hence I do not include the return statement.
I can solve the problem manually but would prefer not to.
Regards,