[fpc-pascal] Platform Dependent Integer Types

Michael Van Canneyt michael at freepascal.org
Fri Apr 7 17:10:49 CEST 2017

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

> 2017-04-06 18:50 GMT-03:00 Mattias Gaertner <nc-gaertnma at netcologne.de>:
>> Why do you think that Delphi's longint has 64bits anywhere?
>> Delphi's NativeInt is 32 or 64bit depending on platform.
> 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.

In short: It is platform dependent in Delphi.

> 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?

NativeInt and NativeUInt are indeed provided for Delphi compatibility.

Which integer type to chose : That depends. 
What do you want to achieve exactly ?


More information about the fpc-pascal mailing list