Add ImportC compiler to dmd

Adam D. Ruppe destructionator at gmail.com
Fri May 14 03:12:36 UTC 2021


On Friday, 14 May 2021 at 03:03:04 UTC, Chris Piker wrote:
> On Linux this trivial, but Windows is a different beast.

You wanna run it from the x86 native tools for VS command prompt 
window, then the PATH is set up for it.

But yeah I do agree it is quite a bit of a pain. Personally, I've 
actually ported full C files to D before to avoid having to deal 
with it (see stuff like jpeg.d and stb_ttf.d in my arsd repo as 
some examples - though i had help with those too).

> Maybe I'm just unlucky (or doing it wrong) but I've never had 
> dstep or htod work without customizing the output by hand.

Well this is what I mean by 90% reliable - you do have to do the 
other 10% by hand. But still that's not too bad.

And tbh I rarely even do that, I just make C bindings as i need 
them by hand.

> If the dmd distribution came with a real C preprocessor and dmd 
> gained the ability to compile most C code, I think the end 
> result would be more user friendly, especially on Windows.  I 
> know I'd try it out.

Yea, there is definitely potential here in making it easier.

Just like if you're willing to spend a few hours doing some 
boring tedium up front it can be done right now too.


More information about the Digitalmars-d mailing list