[fpc-pascal] Platform Dependent Integer Types

Michael Van Canneyt michael at freepascal.org
Fri Apr 7 17:08:19 CEST 2017



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

> 2017-04-07 11:15 GMT-03:00 Marco van de Voort <marcov at stack.nl>:
>
>> In our previous episode, African Wild Dog said:
>>> Which integer types have their size dependent on platform?
>>> E.g. in Delphi, LongInt can 32 or 64 bits depending on the platform.
>>
>> In Delphi they retroactively equated longint to C long, being 32-bit on
>> 64-bits windows and 64-bit on Linux. The Delphi Linux compiler is btw a
>> different compiler than windows.
>>
>> On FPC it is always 32-bit. Ptrint and ptruint scale with pointer size, and
>> integer depends on compilation mode, 16 or 32-bit.
>>
>>
> So, is the size of  "Integer" type dependent on the compilation mode?
> (Delphi is always 32 bits)

Yes. It is 16 bit in fpc/tp mode, 32 bit in Delphi/ObjFPC and MacPas.

Michael.




More information about the fpc-pascal mailing list