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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset