[fpc-pascal] THandle in code that must compile also with Delphi

Juha Manninen juha.manninen62 at gmail.com
Thu Mar 20 11:47:15 CET 2014


FileCreate and FileOpen return THandle with FPC but integer with Delphi2007.
Delphi defines THandle as LongWord but for some reason Integer is used instead.
With FPC on a 64-bit system THandle is 64- bit unsigned.

Question: what is the best way to maintain code that must compile with
both FPC and Delphi2007?
The obvious solution is to use IFDEF and define a new type, say TMyHandle.
FPC's libraries however take care of many platform differences. Is
there any better way to solve this?

Regards,
Juha



More information about the fpc-pascal mailing list