[fpc-devel] Linux.SysInfo Problem

Henry Vermaak henry.vermaak at gmail.com
Fri Mar 19 16:15:04 CET 2010


On 19 March 2010 15:10, David W Noon <david.w.noon at ntlworld.com> wrote:
>
> You will also need to take into account the differences between 32-nit
> and 64-bit platforms.  The struct sysinfo declarations use "unsigned
> long" for most of the fields, but the size of that varies with
> platform: on a 32-bit platform unsigned long is a DWORD; on a 64-bit
> platform unsigned long is a QWORD.

That's why fpc has this in ctypes:

{$ifdef cpu64}
  clong                  = int64;              pclong                 = ^clong;
  cslong                 = int64;              pcslong                = ^cslong;
  culong                 = qword;              pculong                = ^culong;
{$else}
  clong                  = longint;            pclong                 = ^clong;
  cslong                 = longint;            pcslong                = ^cslong;
  culong                 = cardinal;           pculong                = ^culong;
{$endif}

Henry



More information about the fpc-devel mailing list