1. ifdef handling
- Posted by petelomax Dec 30, 2010
- 1172 views
I was just playing around and tried the following:
ifdef WIN32 then puts(1,"WIN32") elsedef puts(1,"NOT WIN32") y end ifdef ifdef WIN32 then constant X = 0 elsedef constant Y = 0 end ifdef constant ifdef WIN32 then X2 elsedef Y2 end ifdef = 0
It forces a line break after elsedef and rejects the constant as invalid use of a reserved word. Thoughts, anyone?
2. Re: ifdef handling
- Posted by jimcbrown (admin) Dec 30, 2010
- 1174 views
petelomax said...
I was just playing around and tried the following:
ifdef WIN32 then puts(1,"WIN32") elsedef puts(1,"NOT WIN32") y end ifdef ifdef WIN32 then constant X = 0 elsedef constant Y = 0 end ifdef constant ifdef WIN32 then X2 elsedef Y2 end ifdef = 0
It forces a line break after elsedef and rejects the constant as invalid use of a reserved word. Thoughts, anyone?
For the third (the issue with the constant), see http://openeuphoria.org/ticket/283.wc
In short, ifdef separates complete statements, and can't be used inside a statement.
I'm not sure why elsedef would force a line break. That might be a bug left over due to some hacky issues in parsing ifdef..then...else...end ifdef statements (prior to the move to rename else to elsedef to avoid those very problems).