Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-04

A few doubts about C to pascal header translations:

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paulo Costa

I've come across some constructs that I'm not sure how to translate:

A procedure where one of the arguments is declared as:
size_t arg;

also a macro where appears:
sizeof(size_t)

I replaced size_t by PtrUInt, is there a better alternative?

Paulo Costa

Reply by email

Marco van de Voort
to Paulo Costa

In our previous episode, Paulo Costa said:

Show quoted text 9 lines
I've come across some constructs that I'm not sure how to translate: A procedure where one of the arguments is declared as: size_t arg; also a macro where appears: sizeof(size_t) I replaced size_t by PtrUInt, is there a better alternative?

On *nix size_t is afaik declared in unit baseunix?

Reply by email

Paulo Costa
to Marco van de Voort
Marco van de Voort wrote 13 lines
In our previous episode, Paulo Costa said: > I've come across some constructs that I'm not sure how to translate: > > A procedure where one of the arguments is declared as: > size_t arg; > > also a macro where appears: > sizeof(size_t) > > I replaced size_t by PtrUInt, is there a better alternative? On *nix size_t is afaik declared in unit baseunix?

Right now I'm working in Linux but I latter would like to make it work in Windows. The main concern was if it was 32/64 bits safe.

Paulo Costa

Reply by email

Marco van de Voort
to Paulo Costa

In our previous episode, Paulo Costa said:

Show quoted text 7 lines
>> I replaced size_t by PtrUInt, is there a better alternative? > > On *nix size_t is afaik declared in unit baseunix? > Right now I'm working in Linux but I latter would like to make it work in Windows. The main concern was if it was 32/64 bits safe.

Then use the FPC internal types, sizeint,sizeuint (size of an allocation) or ptrint/ptruint (size of a pointer).

This because we don't operate on windows via a posix-like layer, but by direct winapi, and follow the typing of the windows api headers, which are generally not unixy.

Reply by email