#include C headers in D code
Chris
wendlec at tcd.ie
Mon Apr 16 09:47:35 UTC 2018
On Monday, 9 April 2018 at 11:03:48 UTC, 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"
This is really cool. This can be _very_ useful in situations
where you don't want to translate all the headers to D,
especially when experimenting with C libs. Really cool. Thanks.
More information about the Digitalmars-d-announce
mailing list