Sign in Join

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

Mailing lists / fpc-devel / 2023-11

vargars vs array of const for WinAPI

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Frb

I saw that in some places (I think gtk2) "varargs" is used for open arrray API calls.

Any reason that is not adapted for Windows (overloaded)?

function wsprintfA(_para1:LPSTR; _para2:LPCSTR; const args:array of
const):longint; cdecl; external 'user32' name 'wsprintfA';
function wsprintf(_para1:LPSTR; _para2:LPCSTR; const args:array of
const):longint; cdecl; external 'user32' name 'wsprintfA';

Reply by email

Marco van de Voort
to Martin Frb

Op 9-11-2023 om 20:47 schreef Martin Frb via fpc-devel:

I saw that in some places (I think gtk2) "varargs" is used for open arrray API calls. Any reason that is not adapted for Windows (overloaded)?

It probably is newer (kylix). I'm not sure anyway what the problem is? Why would varargs be better

Reply by email

Martin Frb
to Marco van de Voort
Marco van de Voort wrote 10 lines
Op 9-11-2023 om 20:47 schreef Martin Frb via fpc-devel: > I saw that in some places (I think gtk2) "varargs" is used for open > arrray API calls. > > Any reason that is not adapted for Windows (overloaded)? It probably is newer (kylix). I'm not sure anyway what the problem is? Why would varargs be better

Not a big deal... Just in case of porting stuff from (newer?) Delphi.

Probably only of interrest if both syntax can live as overloads.

Reply by email