[fpc-pascal] Platform Dependent Integer Types

Marco van de Voort marcov at stack.nl
Fri Apr 7 17:26:05 CEST 2017

In our previous episode, African Wild Dog said:
> >
> http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Internal_Data_Formats_(Delphi)#Platform-Independent_Signed_Integer_Types
> .
> As Marco have pointed out, in Windows the Delphi's LongInt type is always
> 32-bits. On other platforms is platform dependent.

Note that this is a very recent development. It started with the iOS 64-bit
arm compiler a while back, and now since weeks their new Linux offering.

Both however are a different compiler than the regular.
> Still not clear for me. Are NativeInt and NativeUInt provided for Delphi
> compatibility, right? So, if i need an integer type which depends on
> platform/fpc compilation mode, which one should i use?

For what purpose? There are only ones that scale with pointer size, and then
any of the native(u)int, ptr(u)int or int(u)ptr types are ok.

More information about the fpc-pascal mailing list