C struct (with bitfields) to D and back

Jarrett Billingsley kb3ctd2 at yahoo.com
Sun Aug 6 20:13:50 PDT 2006

"Serg Kovrov" <kovrov at no.spam> wrote in message 
news:eb5rcb$2nh$1 at digitaldaemon.com...

> Thanks for reply, Jarrett, I hope it is.
> I actually can't test it right now as Uniscribe is quite complicated 
> subject, and I just started investigating it... As/if I get some results, 
> I'll post it (and perhaps bindings to the API) here.

I worked up a simple example with some oddly-sized bitfields, and it does 
seem to work - I can link to the original C library using the htod'ed D 
module, and it can read the struct bitfields that D produces.  This is using 
DMC though, so it might not be compatible with other compilers.  Hopefully 
other compilers order bitfields the same way DMC does. 

More information about the Digitalmars-d-learn mailing list