ILE C/C++ Compiler Reference

PACKSTRUCT

Specifies the alignment rules to use for members of structures, unions and classes in the source code. PACKSTRUCT sets the packing value to be used for the members of structures, but not for the structures themselves.

If the data types are by default packed along boundaries smaller than those specified by #pragma pack, they are still aligned along the smaller boundaries. For example:

For more information on packing and alignment, see pragma pack.

|--+------------------------------+-----------------------------|
   |              .-*NATURAL-.    |
   '-PACKSTRUCT(--+-1--------+--)-'
                  +-2--------+
                  +-4--------+
                  +-8--------+
                  '-16-------'
 
 
*NATURAL
Default setting. The natural alignment for the members of structures is used.
1
Structures and unions are packed along 1-byte boundaries.
2
Structures and unions are packed along 2-byte boundaries.
4
Structures and unions are packed along 4-byte boundaries.
8
Structures and unions are packed along 8-byte boundaries.
16
Structures and unions are packed along 16-byte boundaries.


[ Top of Page | Previous Page | Next Page | Table of Contents ]