Sven Jauring wrote:
I'm having problem with preprocessor conditionals containing comparisions, eg. "#if X == 4". After the following code has executed, the variable var1 is set to 10,not 15 as I expected.
#define X 4 #define Y 1 . . . var1 := 0;
#ifdef Y var1 := 10; #endif
#if X == 4 var1 := 15;
#endif
First of all: Please post a complete example! You surely have one on your machine, and it's very annoying for me having to fill in the missing parts before I can try the code!
Should this work as I expect?
Yes, and it does on my machine. There was a bug with conditionals on some platforms (fixed meanwhile), but since you didn't specify your platform or GPC version, I can't tell it if that's the problem you're seeing (look for fjf266 in the To-Do list in the GPC manual).
Frank