Hacker Newsnew | past | comments | ask | show | jobs | submit | adamdr's commentslogin

Note that D can call C directly too; all you have to do is add the function's prototype to an extern(C) block in your D code. You can cheat on the prototype too, for example, using void* rather than spell out a struct pointer type, if you're in a rush.

There's also pragmas for adding the needed library to the compile command line.

It's actually pretty easy to use.

D's C++ binding support, on the other hand, leaves quite a bit to be desired... I always do extern C functions to bind them together.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: