title: Struct Byte Alignment Issue XCode 4.3
body: <p>I'm trying to use struct to map header of a BitMap file. It seems that compiler is doing 4byte (32bit) alignment but I need 2Byte. I tried to change that via complier directive as below</p>
  
  <pre><code>#pragma pack(2)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>__attribute__ ((aligned(xx)));
  </code></pre>
  
  <p>those two doesn't seem to have any effect. Is there another way to do this? 
  I'm using XCode 4.3 on Mac OS X Lion. I Tested both Apple LLVM and Apple GCC compliers.</p>
  
  <p>Here is the Struct type definition</p>
  
  <pre><code>typedef struct {
      int16_t bfType; 
      int32_t bfSize;
      int16_t bfReserved1;
      int16_t bfReserved2;
      int32_t bfOffBits;
      int32_t biSize;
      int32_t biWidth;
      int32_t biHeight;
      int16_t biPlanes;
      int16_t biBitCount;
      int32_t biComression;
      int32_t biSizeImage;
      int32_t biXPelsPerMeter;
      int32_t biYPelsPerMeter;
      int32_t biClrUsed;
      int32_t biClrImportant;
  } THeader;
  </code></pre>