3 ms·
Delphi, and I'm sure others, have had[1] this for ages: When you declare a procedure or function, you can specify a calling convention using one of the directi
by magicalhippo 3y ago
Delphi, and I'm sure others, have had[1] this for ages:
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/Procedures_and_Functions_(Delphi) https://docwiki.embarcadero.com/RADStudio/Sydney/en/Procedur...
- pjmlp 3y agoSince the Turbo Pascal days actually.
- magicalhippo 3y agoI was pretty sure it had it, I just couldn't find an online reference.
- pjmlp 3y agoTurbo Pascal for Windows v1.5, on Windows 3.1, the transition step before Delphi came to be.
- magicalhippo 3y agoAh, yeah that makes sense. Thanks!
- JonChesterfield 3y agoC for example does this, albeit in compiler extensions, and with a longer tag than #.