I'm trying to use macro for c code. However, I stuck in using token concatenation
I have below variables.
A, aA, bA, cA ...
And, all of these variables used for same function (situation is a bit complicate, so just passing variable is not enough).
If I have only
aA, bA, cA
Then, I can do using the below macro.
#define CALL_FUNCTION(GROUP) \
FUNCTION(GROUP##A);
However, because of
A
I can't use the mentioned macro anymore. I tried,
#define CALL_FUNCTION(GROUP) \
FUNCTION(GROUP##A);
FUNCTION(NULL);
FUNCTION(a);
FUNCTION(b);
FUNCTION(c);
But actually, NULL is not empty string, it didn't work.
FUNCTION("");
Also didn't work.
There are alternative way like,
#define CALL_FUNCTION(GROUP) \
if(GROUP == NULL)\
FUNCTION(A);\
else\
FUNCTION(GROUP##A);
However, in this case, I need to write few lines more. In my case, it cause much more codes.
I googled a lot, but I couldn't solution. Is there anyone who knows how to token paste with empty string?
Thanks