I'm trying to do a macro substitution, but it doesn't work, here is the code:
#define COMLOG 2
#define __COM_ESPECIAL_print(__a, __comNumber) COM##__comNumber##_print(__a)
#define COM_LOG_print(__a) __COM_ESPECIAL_print(__a, COMLOG)
but when I try to call with:
COM_LOG_print("pepe");
It makes a non expected substitution:
undefined reference to COMCOMLOG_print
What I hope to get:
COM2_print
Any ideas?