[fpc-devel] THandle and 64bit platforms

Marc Weustink marc.weustink at cuperus.nl
Wed Dec 22 14:31:57 CET 2004


>From: fpc-devel-bounces at lists.freepascal.org
>[mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of Florian
>Klaempfl
>Sent: dinsdag 21 december 2004 8:30
>
>Peter Vreman wrote:
>
>>>>That said, the RTL should also avoid confusion with the Windows/Delphi
>>>>THandle type, and introduce a cross-platform and opaque TFileHandle
>>>>type.
>>>
>>>It's text/file/file of in pascal ;)
>>>
>>>
>>>>Which will happen to be equal to THandle on 32-bit windows.
>>>>On 32-bit Linux, the definition of THandle will then also equal
>>>>TFileHandle.
>>>>
>>>>This will also take some work :-)
>>>
>>>I guess this is no solution. It makes porting delphi apps very hard.
>>>What's the problem if thandle is 64 bit on 64 bit systems? You
>>>can still store a 32 bit file handle in it.
>>
>>
>> It'll give a lot of Warnings when compiling the sources. And there is a
>> risk for rangecheck errors.
>>
>> I checked Kylix, there THandle=longword which is also incompatible with
>> our THandle=longint under Linux.
>>
>> My proposal is to rename the current THandle to TFileHandle. And add an
>> platform independent type "THandle=PtrUInt".
>> Note that this can still cause range check errors under Unix, because
>> invalid filedescriptors have (normally) value -1.
>
>Sounds good to me.

This would be nice

Marc





More information about the fpc-devel mailing list