C Bitfields in D

bearophile bearophileHUGS at lycos.com
Tue Dec 7 10:22:15 PST 2010


Stanislav Blinov:

> I'm under the impression that
> 
> struct my_struct
> {
> mixin(bitfields!(
> uint, "i", 1,
> uint, "", 31));
> }
> 
> should do the trick.

But bitfields in C may not use the same alignments used by bitfields!() on DMD so I think you have to test the sanity of the whole thing for each combination of D compiler, operating system and C compiler.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list