Q.
delta trinity
deltatrinity@hotmail.com
Wed, 18 Dec 2002 16:25:07 -0500
> > Note that the calling convention may depend on how GMP is compiled
> > (I'm not sure if it may be varied or what it is if not so) but you may
> > need to use one of the keywords "cdecl" or "stdcall" in the external
> > declarations.
>
>It should be cdecl, certainly the assembler code is all written only
>for cdecl.
>
>There's a gmp unit in GNU Pascal, if that helps maybe as a starting
>point.
As far as I know, all DLL use "stdcall" (or equivelent). It's also the
default PASCAL calling convention. I remember also seeing, a long time ago,
declaring the calls in C with "PASCAL" statement in front of the functions.
This have to do with the way parameters are pushed to the stack and poped
from it. In standard 'C', when a function call another function, it pushes
the parameters on the stack and the philosophy is that since it have pushed
the parameters, it's it's job (the caller) to clear them from the stack
after. In PASCAL, it's the inverse. The caller pushes the parameter but
the called function clear them on return so the caller don't have to
'bother' clearing them each times. That's also the standard for DLL
exported functions.
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail