Next: Weak Pragmas, Previous: Symbol-Renaming Pragmas, Up: Pragmas
For compatibility with Win32, GCC supports a set of #pragma
directives which change the maximum alignment of members of structures,
unions, and classes subsequently defined. The n value below always
is required to be a small power of two and specifies the new maximum
alignment in bytes.
#pragma pack(
n)
pushes the current maximum alignment setting
onto an internal stack and then sets the new maximum alignment. (APPLE ONLY)
#pragma pack()
acts like a #pragma pack(pop)
directive.
(APPLE ONLY)
#pragma pack(push[,
n])
pushes the current maximum alignment
setting onto an internal stack and then optionally sets the new maximum
alignment.
#pragma pack(pop)
restores the maximum alignment setting to the
one saved at the top of the internal stack (and removes that stack entry).