How to convert C to D using compiler?

max haughton maxhaton at
Wed Dec 8 00:18:04 UTC 2021

On Tuesday, 7 December 2021 at 20:37:12 UTC, bachmeier wrote:
> On Tuesday, 7 December 2021 at 16:52:47 UTC, ManKey wrote:
>> On Tuesday, 7 December 2021 at 16:49:58 UTC, 12345swordy wrote:
>>> [...]
>> I just want to convert from C file to D file, don't import it
> There's no way to convert arbitrary C files to D, but:
> - You can compile C files directly if they are C11-compatible. 
> You include them on the command line like .d files and import 
> them the same as D modules. You have to run the C files through 
> the preprocessor manually. There's not much support for GCC 
> extensions.
> - You can convert header files using 
> [dstep](
> - You can include C header files directly in D modules using 
> [dpp](

No way yet, expect a forum post / PR soon

More information about the Digitalmars-d mailing list