Main Page | Modules | File List | Globals | Related Pages

Calling Conventions
[Exported Symbols and Macros]


Detailed Description

Different platforms may provide different calling conventions for function calls, varying how parameters are passed, arguments are returned, what registers to save, etc. On platforms where there is no analog for a particular convention then the specification is ignored.


Defines

#define POSH_CDECL
#define POSH_STDCALL
#define POSH_FASTCALL


Define Documentation

#define POSH_CDECL
 

Specifies that a function should use the C calling convention. The cdecl convention passes parameters on the stack, with the caller responsible for cleaning up the stack (which in turn allows for variable argument lists). It's marginally slower than the other calling conventions, and is the default calling convention for the C language.

extern void POSH_CDECL someFunction( const char *, ... );

Note:
This is relevant on only a few platforms, notably x86.

#define POSH_FASTCALL
 

Specifies that a function should use the register/"fastcall" calling convention. The fastcall convention passes as many parameters as possible via registers. If there is an overflow, the remaining parameters are passed on the stack. It is the called function's responsibility to clean up the stack.

extern void POSH_FASTCALL someFunction( int x, int y, int z );

Note:
This is relevant on only a few platforms, notably x86.

#define POSH_STDCALL
 

Specifies that a function should use the PASCAL/"stdcall" calling convention. The stdcall convention passes parameters on the stack, however the called function is responsible for stack cleanup. This is slightly faster than cdecl, but without the ability to handle variable argument lists. It is also the default calling convention for the Pascal language.

extern void POSH_STDCALL someFunction( void );

Note:
This is relevant on only a few platforms, notably x86.


Generated on Tue Jan 31 18:27:36 2006 for POSH by doxygen 1.3.7