Deimos (How to port a header)

Marco Leise Marco.Leise at gmx.de
Thu Jan 31 12:42:18 PST 2013


Maybe Deimos (the GitHub presence) could use a dry piece of
text that explains how to convert a header. I have just had
the need for xcb for example, but no idea how a good header
translation is supposed to look like, if all files need to be
converted already on the first go and other questions, like if
all functions should be marked nothrow for example.

Also it looks like a long on Windows is 32-bit while on Linux
it depends on the machine word size and libraries like xcb use
"architecture dependent includes" for whatever that means in
praxis.

There was even a "Variant" struct that gets additional fields,
if the system compiler supports 64-bit ints. This can get ugly
really fast and I just went with the comment that said that
all interesting compilers support some kind of 64-bit int.

So my impression is that currently only people with a
good background of C on multiple platforms can reliably create
Deimos bindings, unless they share their insights, possibly as
a link from GitHub/Deimos to the Wiki on dlang.org.
("Aldacron"'s blog post is a great start, but I'm looking for
something extendable and collaborative.)

I just imagined if I wrote DBus bindings and someone else
wrote XCB bindings, we can share and benefit both. Also Deimos
is ideal to be imported as Git sub-modules in other projects.
A native D GUI library needs that stuff as well in the long
term.

-- 
Marco



More information about the Digitalmars-d-learn mailing list