Am 13.10.2011 11:53, schrieb Alex Shishkin:
another alternative. in {$H-} no changes string=shortstring, in {$h+}
string = ansistring or unocodestring in delphiunicode mode) by default
but can be redefined directly in code (or this definition is set in
ObjPas unit) "type string = MyNiceStringType". and this redefinition is
inherited from used unit if all of them compiled in {$h+} mode. In other
words if unit has directive {$h-} string=shortstring in any case, but if
unit has {$h+} it use "string" type from used unit as it is regular type.

Defining the "string" type in a unit (e.g. the ObjPas unit) is a bad idea if you want to keep the capability to change the "string" type on a per unit base as you can't change the compiled ObjPas unit. Also you'd need a unit for every string type that should be supported. The proposal where "string" is changed based on some compiler option/define is better (though the question about its use or consequences is still not solved).

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to