Comment by magicalhippo
2 years 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/Procedur...
Since the Turbo Pascal days actually.
I was pretty sure it had it, I just couldn't find an online reference.
Turbo Pascal for Windows v1.5, on Windows 3.1, the transition step before Delphi came to be.
1 reply →
C for example does this, albeit in compiler extensions, and with a longer tag than #.