C struct -> D struct (alignment hacks)

Mike vertex at gmx.at
Wed Feb 4 11:55:10 PST 2009


Hi!

I'm in the process of translating some C headers (still ffmpef ->  
libavcode and libavformat) to D and there are some really ugly structs in  
the C headers which I'm trying to translate.

- C -

typedef struct xy
{
     int a:1;
     int b:2;
     int c;
}

- D -

struct xy
{
     align (1)
     {
         int a;
     }
     align (2)
     {
         int b;
     }
     int c;
}

Are those definitions equivalent?

-Mike


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Digitalmars-d-learn mailing list