THandle is declared as System.THandle (32 bits) both in SysUtils and Classes. It's also declared as PtrUInt in LclType on non-Windows systems.
Hello,
Just for windows, system includes systemh.inc which includes sysosh.inc which defines:
{$ifdef CPU64}
THandle = QWord;
ULONG_PTR = QWord;
{$else CPU64}
THandle = DWord;
ULONG_PTR = DWord;
{$endif CPU64}
Correct. Hence why THtmlPort worked on Win64 without reordering the uses statement.
On OS X, something similar:
{$ifdef CPU64}
THandle = Int64;
{$else CPU64}
THandle = Longint;
{$endif CPU64}
Although note that these are signed integers.
But on Linux:
{ fd are int in C also for 64bit targets (x86_64) }
THandle = Longint;
I don't know what "fd" is, but this is what caused the conflict with the 64-bit THandle declared in LclType.
If you never use THandle, but instead use only its common surrogates (HFONT, HGDIOBJ, HWND, etc.), this conflict likely won't become apparent since these "H" types are all 64 bits with Linux64.
All in all, some things to keep us on our toes!
Thanks.
-Phil