Using dpp on the openmpi headers

Atila Neves atila.neves at gmail.com
Fri Mar 13 21:43:23 UTC 2020


On Friday, 13 March 2020 at 10:44:08 UTC, Andre Pany wrote:
> On Friday, 13 March 2020 at 08:08:17 UTC, Peter Jacobs wrote:
>> Given the recent thread that mentioned dpp for generating an 
>> interface module for a C library, I thought that I would give 
>> it a go on the openmpi headers.  I am working in  LinuxMint 
>> system and after making a symbolic link for libclang.so, I 
>> have had some success but not complete success.
>>
>> [...]
>
> DPP cannot translate macros.

It can translate some macros, but not all.

> Another problem is inlined functions.

Yes. Technically I could add support for them by adding 
translation functions for all possible C AST nodes (I shudder to 
even consider C++ here), but it'd be quite a bit of work.

> While DPP generates their headers, their implementations are 
> missing in the binary files.
> In both cases you have to reimplement the functions in D.

Not quite - you can force a C compiler to emit code for them and 
link to it, using the dpp-translated declaration during 
compilation. It's how D supports calling C++ template functions 
now.



More information about the Digitalmars-d mailing list