<p>Am 29.02.2016 16:04 schrieb "Chavoux Luyt" <<a href="mailto:chavoux@gmail.com">chavoux@gmail.com</a>>:<br>
><br>
><br>
> Hi guys,<br>
><br>
> Just a stupid question, but is the Lazarus calling conventions documented anywhere? Is it different from Delphi calling conventions? When calling external c functions from libraries, does one need any special declarations like in Delphi to tell it to use c-style calling conventions?</p>
<p>The register calling convention on i386 should be the same as Delphi's. The others (cdecl, stdcall, pascal) are implemented in a compatible way as well. On other platforms there is only one calling convention (exceptions on e.g. Amiga aside) which is the platforms default calling convention.</p>
<p>><br>
> Related (it was actually Bo's question that got me thinking about this... how easy/difficult would it be to write Linux drivers in Object Pascal, but in a way that C/C++ programs can also use it? Or for that matter (since Lazarus has been ported to Haiku) it might be easier to write drivers for Haiku in Pascal rather than C? Maybe speed things up a bit?</p>
<p>For driver development in kernel mode you'll more often than not need a completely custom RTL. Exceptions would only be micro kernel system of which drivers are user mode processes as well and user mode driver frameworks.</p>
<p>Regards,<br>
Sven</p>