FFI Again (last time, I promise!)
Jarvis, Robert P. (Contingent)
Jarvisb at timken.com
Tue Oct 17 13:18:04 UTC 2000
wsprintf(char *string, char *format, ...) is a vararg function in the
Windows API, and it uses the __cdecl calling convention. I guess that's why
they support multiple calling conventions; you choose whatever is needed to
satisfy your requirements. __stdcall saves an instruction per call, so I
guess it makes sense to use it whenever possible; but you're right, __cdecl
is necessary for variable arguments, so it's good to have around.
Bob Jarvis
Compuware @ Timken
> -----Original Message-----
> From: Bert Freudenberg [mailto:bert at isg.cs.uni-magdeburg.de]
> Sent: Tuesday, October 17, 2000 8:59 AM
> To: 'squeak at cs.uiuc.edu'
> Subject: RE: FFI Again (last time, I promise!)
>
>
> On Tue, 17 Oct 2000, Jarvis, Robert P. (Contingent) wrote:
>
> > The advantage to __stdcall and __pascal is that the
> function arguments are
> > popped from the stack by the called function.
>
> OTOH with cdecl it's easier to implement variable argument count - the
> calling function knows how many args were pushed. I guess
> there are no var
> args in the Win/Mac APIs?
>
> -- Bert
>
More information about the Squeak-dev
mailing list
|