I have used following macro:
#define chSTR2(x) #x
#define chSTR1(x) chSTR2(x)
#define TODO(x) message(__FILE__"(" chSTR1(__LINE__) ") : TODO: " #x)
#define TODOEX(msg, usr) __pragma(message(__FILE__"(" chSTR1(__LINE__) ") : TODO("#usr"): " #msg))
When I try to use it inside my code like this:
TODOEX("Implement case when knzKorrIRS=j", kun01826);
And I try to compile this on Linux machine with gcc compiler (version 4.7.3) I get following error:
some_file.cpp:152:7: error: 'message' was not declared in this scope
some_file.cpp:152:7: error: '__pragma' was not declared in this scope
On my Windows machine with Microsoft compiler (Visual Studio 2013) I get no errors and everything works ok.
If I use TODO in my code in the following way
#pragma TODO(Some text)
then everything is ok (also on Linux machine with gcc).
I have tried to look for an answer but did not find anything which would explain the problem in gcc. So, can please somebody explain me what did I do wrong and how can I correct this that it would compile also on my Linux machine with gcc compiler installed.