[fpc-pascal] Platform Dependent Integer Types

Michael Van Canneyt michael at freepascal.org
Fri Apr 7 17:33:13 CEST 2017



On Fri, 7 Apr 2017, African Wild Dog wrote:

> 2017-04-07 12:10 GMT-03:00 Michael Van Canneyt <michael at freepascal.org>:
>
>>
>> NativeInt and NativeUInt are indeed provided for Delphi compatibility.
>>
>> Which integer type to chose : That depends. What do you want to achieve
>> exactly ?
>>
>>
> In Delphi, if i want an integer type which depends on the target platform
> (32 or 64 bits) i can use the NativeInt and NativeUInt types. What is the
> FPC standard type for this? PrtInt and PtrUInt? (I usually mix both delphi
> mode and objfpc mode units in the same project).

You can use PrtInt and PtrUInt for this or NativeInt and NativeUINT, they
should be equivalent.

The only 'dubious' case may be the 8086 msdos case, which is somewhat confused
about what exactly constitutes a pointer... There you may be better off with 
NativeInt and NativeUINT.

Michael.



More information about the fpc-pascal mailing list