I have various define statements for handling different Delphi versions in an include file. This include file is "included" in an unit. The compiler respects the defines given in the include file but the IDE not. This results in an addition of certain units to the uses clause which are can be already there - enclosed in a DEFINE compiler directive.
Therefore, if a unit is added which isn't available in pre Delphi XE3 you will have a big problem because if you let the IDE add the unit and can not compile it with a pre Delphi XE3 version which doesn't have that unit.
E.g. a project with one unit with an TActionList on it.
MYINCLUDE.INC
only one define{$DEFINE DELPHIXE3}
A sample unit may look like
unit Unit1; {$I MYINCLUDE.INC} uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, {$IFDEF DELPHIXE3} System.Actions, {$ENDIF} Vcl.ActnList; ...
After a save the IDE adds
System.Actions
add the end of the uses list which in turn results in an Identifier redeclared compiler error. If you delete it the IDE will add it again the next save.
I have just reported that to QC #111178.
Is there a workaround for that bug?
Christian
System.Actions
doesn't exist in XE2. – Acting