Hello,
Everytime that I try to compile my code with multiple line macros I get an error:
Error : C2450: Expected: ~(IDENT auto const extern registrar static typedef volatile __interrupt
The code that it is refering to is:
#define PACK8(x,y) \
{ \
CLEAR8(0, x, 0xff); \
PUT8(0, x, y, 0xff); \
}
I have used this same syntax in many other compilers, but I can not get it to compile in Codewarrior for Microcontrollers V6.2.
I would greatly appreciate any advice. Due to the nature of the code, changing these macros to single line ones would not be a desirable solution.
Cheers.
Solved! Go to Solution.
#define PACK8(x,y) { \ CLEAR8(0, x, 0xff); \ PUT8(0, x, y, 0xff); \ }
#define PACK8(x,y) { \ CLEAR8(0, x, 0xff); \ PUT8(0, x, y, 0xff); \ }
Maybe a space problem?
The initial line in the initial post has some spaces after the backward slash character:
With quotes around the string:
"#define PACK8(x,y) \ "
The \ must be the last character on the line, if it is followed by a space then the slash just escapes the space.
For such errors I would always have a look at the preprocessor output.
Daniel