Re: [Lazarus] Free Pascal / Lazarus calling conventions

2016-02-29 Thread Sven Barth
Am 29.02.2016 16:04 schrieb "Chavoux Luyt" :
>
>
> Hi guys,
>
> 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?

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.

>
> 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?

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.

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Free Pascal / Lazarus calling conventions

2016-02-29 Thread Chavoux Luyt
Hi guys,

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?

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?

Cheers,
Chavoux
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus