ifdef changes, 4.0 code may break.

new topic     » topic index » view thread      » older message » newer message

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:

  1. and
  2. 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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu