Is it feasible to slowly rewrite a C++ codebase in D?
drug
drug2004 at bk.ru
Tue Jul 17 06:57:37 UTC 2018
16.07.2018 17:32, bachmeier пишет:
> On Friday, 13 July 2018 at 19:53:45 UTC, Laeeth Isharc wrote:
>> On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso
>> wrote:
>
>>> What are your ideas?
>>
>> If you would like to expose C function and type declarations to D, you
>> could take a look at DPP, which allows you to just #include a C
>> header. If you encounter a bug, please file an issue and in time we
>> will fix it.
>>
>> Does not yet work for C++ except in some cases.
>>
>> https://github.com/atilaneves/dpp
>
> I would like to give this a try, but I don't see any instructions for
> installation on the Github page. I tried dub build dpp, but I got a
> bunch of error messages.
I just build it using dub then do something like that(from memory):
`d++ some_c_header.h --include-path path/to/other/c/header/files
--keep-d-files` and it generates d file for the corresponding c header.
Although dpp is intended to be used directly I use it for generating
intermediate files. First of all because when I tried to import
nuklear.h dpp generated nuklear.d with simple error - due to bug it
included diagnostic message of libclang into d file and it was simpler
and faster to edit intermediate file manually than wait for bug fixing.
More information about the Digitalmars-d-learn
mailing list