I'm having problems with the cpp preprocessor. I have this Input.h file as follows:
#ifndef PLATFORM_MOBILE1111
#define MyTest WEB111
#endif
int MyTest;
I process it with this command (on OSX):
cpp -E -P Source/Input.h Generated/Output.h
I get this:
#define MyTest WEB111
int MyTest;
i.e. MyTest macro is not applied. Why?
After several experiments, I found that if I insert an empty line, variable definition, comment, or any other line after the #ifndef line, then this works fine.
#ifndef PLATFORM_MOBILE1111
#define MyTest WEB111
#endif
int MyTest;
Thus, the result entered above is processed correctly:
int WEB111;
Can someone explain to me why this is happening? and how to solve it? Is there an option I can go through?
Edit: I also found that ## (the concatenation operator) doesn't work either!