[fpc-devel]proposition changes in unit TYPES

Peter Vreman peter at freepascal.org
Thu Oct 2 14:04:23 CEST 2003

> I try use FPC 1.1 for Windows
> and I have problem with some of types declarations
> for example THandle is declared many times
> in WINDOWS.PP (base.inc) is:
>   Thandle= HANDLE = type Cardinal;
> in CLASSES (classesh.inc)
>   THANDLE = longint;
> with other types like POINT RECT I have similar problems: many collisions
> with different types
> in 1.1RTL is unit TYPES but for me is not good
> I suggest to prepare TYPES to fundamental unit
> declares in it all common types
> and reuse them in CLASSES, WINDOWS, UNITS
> but TYPES must not use any unit, (delete WINDOWS, SYSUTILS from interface)
> with this changes can be avoid problems with misplaced types

When it is such a common unit the types can also be defined in the system
unit. But we want to stay as much as compatible as possible. And that is
not always easy especially not with the Windows specific delphi issues
like THandle.

For the THandle it needs to be defined in Windows unit and can then uses
as 'type renaming' in units like Sysutils


But that will then need an $ifdef win32. So it needs to be investigated
better where to define basic types so they can be used and should be
redefined for compatibility.

More information about the fpc-devel mailing list