www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - align structs?

reply Robert Atkinson <Robert.Atkinson gmail.com> writes:
Is there anyway to align a struct, for example to 16 byte memory locations?

I tried:
align(16)
struct x
{
        // blah
}

but x.alignof always returns 4.
May 02 2005
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Robert Atkinson" <Robert.Atkinson gmail.com> wrote in message 
news:d56uj1$nv6$1 digitaldaemon.com...
 Is there anyway to align a struct, for example to 16 byte memory 
 locations?

 I tried:
 align(16)
 struct x
 {
        // blah
 }

 but x.alignof always returns 4.
Nothing over align(4) seems to work. Might be a bug (or a limitation of the compiler?).
May 03 2005