ifdef changes, 4.0 code may break.
- Posted by jeremy (admin) Mar 07, 2009
- 920 views
I just committed (rev 1426) a change to the way ifdef statements are handled. They are greatly expanded but also contains a change that may break existing 4.0 code.
In euphoria, we use the not keyword, not ! to negate a statement. An example of the previous syntax:
ifdef !DOS32 then -- do things that are for non-DOS platforms end ifdef
This syntax has been changed to be more Euphorian.
ifdef not DOS32 then -- do things that are for non-DOS platforms end ifdef
Important: Current 4.0 still handles "!DOS32" syntax, however, this will be removed after the next alpha has been released. You must update your code to use the "not DOS32" syntax.
Now, we have got some further changes on the ifdef system with this commit as well. It now supports simple conjunctions:
- and
- or
Example:
ifdef DOS32 or WIN32 then -- DOS or Windows code end ifdef ifdef DOS32 and not DEBUG then -- non debug DOS code end ifdef ifdef DOS32 or WIN32 or LINUX then -- DOS or Windows or Linux end ifdef
The examples could go on. I committed a test case for many different combinations that you may wish to look at.
Jeremy