On 12 Oct 2011, at 09:56, Marco van de Voort wrote:
If it was just one class it would work. But essentially it is all
OOP. (e.g.
tcomponent and tcontrol has string properties, and thus the whole of
lazarus),
Lazarus doesn't have to change anything. They are free to follow the
path you proposed for FPC: ship two completely separate LCLs (one
compiled with string = unicodestring and one compiled with string =
ansistring).
same for the OOP parts of packages/ It would also mean rewriting
delphi code using such schemes to be encoding agnostic to follow this.
If a class in the RTL or packages is by nature already encoding-
agnostic, the rewriting would consist of this:
type
tcomponent =
FpcStringModeDifferentiatedType(tansicomponent,tunicodecomponent);
generic tgenericcomponent<T> = class
..
end;
tansicomponent = specialize tcomponent<ansistring>;
tunicodecomponent = specialize tcomponent<unicodestring>;
(or use the Delphi variant of the generic syntax). That would indeed
require some ifdefs to keep the code compilable also by Delphi. No
solution will be completely free.
Jonas
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel