|
|
|
|
|
by vrotaru
792 days ago
|
|
There was an interesting aproach to this, in an experimental language some time ago fn f1 (x, y) #-> // Use C calling conventions
fn f2 (x, y) -> // use fast calling conventions
The first one was mostly for interacting with C code, and the compiler knew how to
call each function. |
|
When you declare a procedure or function, you can specify a calling convention using one of the directives register, pascal, cdecl, stdcall, safecall, and winapi.
As in your example, cdecl is for calling C code, while stdcall/winapi on Windows for calling Windows APIs.
[1]: https://docwiki.embarcadero.com/RADStudio/Sydney/en/Procedur...