interfacing C bitfield structs

Wolfgang Draxinger wdraxinger at darkstargames.de
Sat Mar 18 05:22:32 PST 2006


Regan Heath wrote:

> I don't know if you'd call this elegant but here is what I did.
> The important thing is using a type which is the correct size
> for the bitfields and then creating some way to interface the
> bits you need.

I had the same idea and solved it this way. Doesn't seem elegant
to me though.

> Note: The commented types shown in the struct were an attempt
> to use D's bit type. They were originally C bitfields.

The same crossed my mind, too, but I was unsure how data
alignment would interfere with this.

-- 
Wolfgang Draxinger




More information about the Digitalmars-d mailing list