[fpc-devel] Re: WinCE port patches

Yury Sidorov jura at ce.blagovest.com
Mon Jul 4 08:50:39 CEST 2005


From: "Florian Klaempfl" <F.Klaempfl at gmx.de>

>>>>>> 2. WinCE is unicode only OS. How would be better to handle it? RTL 
>>>>>> has variables/function parameters wich are PChar/Strings. I think in 
>>>>>> unicode systems PWideChar/WideStrings should be used.
>>>>>
>>>>>
>>>>>
>>>>> Yes. Introduce some TOSString for the windows rtl which is ansistring 
>>>>> on non ce and widestring on ce and use it if ansistring is suffient.
>>>>
>>>>
>>>>
>>>> And POSChar for PChar/PWideChar. Or maybe SysString and PSysChar?
>>>> Modifications in many files will be needed. Who will do that?
>>>
>>>
>>> I meant mainly for the system unit etc., not the windows unit, so it 
>>> shouldn't be that much.
>>
>>
>> I meant types must be defined in system units for other targets too. For 
>> example there is global variable cmdline. Currently it is PChar and it is 
>> assigned in every system unit. We will change it to PSysChar and PSysChar 
>> must be defined properly in every system unit.
>
> The question is if the real command line shouldn't be assigned to the 
> PChar cmdline. If someone wants the unicode command line he should use a 
> WinCE syscall. How is this handled in the GNU port to arm-wince? What type 
> does argv have?

In GCC for WinCE argv[] is char* and conversions from Unicode to ANSI are 
performed.
The same conversions can be done in FPC too.

So what way should we go?

1. Leave RTL string types as is (PChar/AnsiString) and perform conversion 
from Unicode if needed.

2. Define new types PSysChar/SysString to correspond either PChar/AnsiString 
or PWideChar/WideString depending from OS type.

3. Be avare of UNICODE define and produce fully Unicode RTL if it is defined 
and ANSI RTL if it is not defined.

Yury Sidorov.






More information about the fpc-devel mailing list