Original Post
Hello, I've got a kind of weird (to me, its weird) problem. I define a few words and then want to use them. So to combine the LEFTBOTTOM with the LEFTTOP I use a bitwise or, | . The problem is, the preprocessor doesn't do, what it is supposed to do. (or isn't doing what I think it should be doing ;) ) I think this small program will make it clear: If the precessor replaces all the defines, it is exactly the same as char a = 0x40 | 0x80 (the previous line) and should not throw me an error. Any help is appreciated. Thanks in advance. Kamos
#define TOPLEFT 0x01;
#define TOPRIGHT 0x02;
#define RIGHTTOP 0x04;
#define RIGHTBOTTOM 0x08;
#define BOTTOMRIGHT 0x10;
#define BOTTOMLEFT 0x20;
#define LEFTBOTTOM 0x40;
#define LEFTTOP 0x80;
int main()
{
char a = 0x40 | 0x80; // <--- this is OK
char b = LEFTBOTTOM | LEFTTOP; // E2188: expression syntax error
return 0;
}