#include C headers in D code

Atila Neves atila.neves at gmail.com
Wed Apr 11 10:12:37 UTC 2018


On Wednesday, 11 April 2018 at 06:12:49 UTC, rikki cattermole 
wrote:
> On 09/04/2018 11:03 PM, Atila Neves wrote:
>> Here's my blog post about my project that allows directly 
>> #including C headers in D*
>> 
>> https://atilanevesoncode.wordpress.com/2018/04/09/include-c-headers-in-d-code/
>> 
>> 
>> The summary is that, modulo bugs, things like this work:
>> 
>>      #include <stdio.h>
>>      void main() { printf("Hello world\n".ptr); }
>> 
>> So far it's successfully compiled whilst #including pthread, 
>> libcurl, openssl and others. The blog and the github README 
>> have more information, and feel free to reply to this with 
>> questions.
>> 
>> dub: http://code.dlang.org/packages/dpp
>> reddit: 
>> https://www.reddit.com/r/programming/comments/8axj53/include_c_headers_in_d_code/
>> 
>> hacker news: It's in there somewhere, search around.
>> 
>> Atila
>> 
>> * Technically, "D + #include directives + C macros"
>
> Any chance objectice-c as well?

I don't know Objective-C. The only way I can think of to even get 
close to getting it to work is by copying the relevant tests from 
dstep. I also don't think the language is nearly as important as 
C and C++ in terms of fostering D adoption.

So probably no unless someone sends PRs my way.



More information about the Digitalmars-d-announce mailing list