ILE C/C++ Compiler Reference
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 and
for the structures themselves.
If the data types are by default packed along boundaries
smaller than those boundaries specified by #pragma pack, they are
still aligned along the smaller boundaries. For example:
- Type char is always aligned along a 1-byte boundary.
- 16-byte pointers are aligned on a 16-byte boundary. PACKSTRUCT,
_Packed, and #pragma pack cannot alter this alignment.
- 8-byte pointers can have any alignment, but 8-byte alignment is
preferred.
For more information about packing and alignment, see pragma pack.

PACKSTRUCT Syntax:
|--+------------------------------+-----------------------------|
| .-*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 | Contents |
Index ]