My code is
#define PASTE__(a, b) a##b
#define PASTE_(a, b) PASTE__(a, b)
#define PASTE(a, b) PASTE_(a, b)
int main()
{
PASTE(1, (1+3)/4);
return 0;
}
I would LIKE to have the result be
int main()
{
11;
return 0;
}
Compilable link: http://coliru.stacked-crooked.com/a/b35ea3e35a1b56ae
I put in two levels of indirection suggested by How can I guarantee full macro expansion of a parameter before paste?.
But still I get a preprocessor error:
main.c:8:11: error: pasting "1" and "(" does not give a valid preprocessing token
PASTE(1, (1+3)/4);
^
main.c:1:23: note: in definition of macro 'PASTE__'
#define PASTE__(a, b) a##b
^
main.c:3:21: note: in expansion of macro 'PASTE_'
#define PASTE(a, b) PASTE_(a, b)
^
main.c:8:5: note: in expansion of macro 'PASTE'
PASTE(1, (1+3)/4);
How do I get the preprocessor to resolve the result of that expression before doing concatenation?