Is it feasible to slowly rewrite a C++ codebase in D?

bachmeier no at spam.net
Tue Jul 17 15:55:03 UTC 2018


On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote:
> 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.

I'm going to create an issue on Github. This is the output I get:

$ dub build dpp
Building package dpp in /home/office/.dub/packages/dpp-0.0.1/dpp/
WARNING: A deprecated branch based version specification is used 
for the dependency libclang. Please use numbered versions 
instead. Also note that you can still use the dub.selections.json 
file to override a certain dependency to use a branch instead.
Performing "debug" build using /usr/bin/dmd for x86_64.
libclang ~master: target for configuration "library" is up to 
date.
dpp 0.0.1: building configuration "executable"...
.dub/packages/dpp-0.0.1/dpp/source/dpp/runtime/app.d(106,16): 
Warning: C preprocessor directive #define is not supported
.dub/packages/dpp-0.0.1/dpp/source/dpp/cursor/typedef_.d(89,9): 
Error: @nogc function dpp.cursor.typedef_.isSomeFunction cannot 
call non- at nogc function clang.Type.pointee
.dub/packages/dpp-0.0.1/dpp/source/dpp/type/package.d(176,8): 
Error: incompatible types for (type.pointee()) is (null): Type 
and typeof(null)
.dub/packages/dpp-0.0.1/dpp/source/dpp/type/package.d(177,12): 
Error: incompatible types for (type.pointee()) !is (null): Type 
and typeof(null)
.dub/packages/dpp-0.0.1/dpp/source/dpp/type/package.d(184,40): 
Error: can only * a pointer, not a Type
.dub/packages/dpp-0.0.1/dpp/source/dpp/type/package.d(192,21): 
Error: can only * a pointer, not a Type
.dub/packages/dpp-0.0.1/dpp/source/dpp/type/package.d(202,22): 
Error: cannot implicitly convert expression (*ptr).pointee() of 
type Type to const(Type)*
.dub/packages/dpp-0.0.1/dpp/source/dpp/type/package.d(246,31): 
Error: can only * a pointer, not a Type
/usr/bin/dmd failed with exit code 1.



More information about the Digitalmars-d-learn mailing list