Calling C functions

Jacob Carlborg doob at me.com
Tue Jun 30 12:51:31 UTC 2020


On Tuesday, 30 June 2020 at 12:22:15 UTC, Steven Schveighoffer 
wrote:

> (i.e. one cannot use extern(D) functions for C callbacks).

I don't think that's a big issue. Honestly, I don't think it's an 
issue at all.

BTW, the order of arguments is not the only thing. Variadic 
functions in D and C are completely different. I don't think it's 
possible to implement a C style variadic function with D linkage 
(the language doesn't provide a syntax for it).

There's also D specific types which C cannot handle (like arrays 
and delegates).

I'm sure there are other differences in the ABIs.

--
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list