Hello, I'm reading about C calling conventions.
I found this explanation:
"The pascal keyword is
used in the prototype and definition of the function to tell the compiler to
use this convention. In fact, MS Windows API C functions use the Pascal
convention. Why? It is a little more efficient than the C convention."
"The difference in stdcall and cdecl is that stdcall requires the subroutine
to remove the parameters from the stack (as the Pascal calling convention
does). Thus, the stdcall convention can only be used with functions that
take a fixed number of arguments (i.e. ones not like printf and scanf)."
If someone can explain me what is difference between stdcall and pascal calling convection. In MSDN I found #define WINAPI __stdcall, so according to this API uses stdcall convention.
I also found in MSD when learning win socket api this:
int PASCAL FAR bind ( SOCKET s, const struct sockaddr FAR * name, int namelen); "
So it uses Pascal convention.
Thanks very much for help!