[fpc-devel] THandle and 64bit platforms
Peter Vreman
peter at freepascal.org
Tue Dec 21 07:57:40 CET 2004
>> 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.
More information about the fpc-devel
mailing list