Name
CDecl Directive
Syntax
Subroutine declaration; cdecl;Description
The
cdecl directive tells the compiler to use C-style
calling conventions for the function or procedure. The caller of the
subroutine pushes arguments onto the stack, starting with the
rightmost argument. After the subroutine returns, the caller pops the
arguments from the stack.
Functions return ordinal values, pointers, and small records or sets
in EAX and floating-point values on the FPU stack.
Strings, dynamic arrays, Variants, and large
records and sets are passed as a hidden var
parameter. This hidden parameter is the first parameter, so it is
pushed last onto the stack. If the subroutine is a method,
Self is pushed just before the function’s
var result (if one is needed).
See Also
| Function Keyword, Pascal Directive, Procedure Keyword, Register Directive, SafeCall Directive, StdCall Directive |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access