[fpc-devel] The (near) future of strings

Marco van de Voort marcov at stack.nl
Mon Mar 7 15:43:48 CET 2016


In our previous episode, Mattias Gaertner said:
> >[...]
> > > Do you mean the dotted unitname will not be needed when the compiler
> > > is extended to support namespace prefixes (project and command line
> > > switch)?
> > 
> > I assume not since that would be Delphi incompatible. Under delphi this is
> > possible.
> 
> You lost me here.
> Why would implementing the Delphi features be Delphi incompatible?

D7+ have dotted units support. DXE2 rename the RTL units to dotted units.

DXE2+ also allow to introduce the scopeprefix so that you don't need to use dotted
units (iow if you uses sysutils, then System.sysutils.dcu is found etc).

So I use

@dcc32 "-NSSystem;System.Win;WinAPI;Vcl;Vcl.Imaging;Data;VclTee" %1 %2 %3 %4 %5 %6

in a batchfile and I can use all unit names without scopenames.


However in Michael's scheme with Sysutils using Ansi and System.Sysutils
using unicodestring this will fail.

Worse, one mistake in your sources (e.g. a non qualified forms) and you get
bunches of "Incompatible Type Forms.TForm, expected VCL.Forms.TForm" style errors.

I think some solution with alternative -Fu settings is to be prefered and
not abuse an unrelated feature (dotted unitnames) to have both ansi an
unicodestrings in one install.



More information about the fpc-devel mailing list