[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
pack

Description:
Controls the alignment of data structures.
Compatibility:
This pragma is compatible with the following platform targets:
Prototype:
#pragma pack( [n | push, n | pop] )
Remarks:
Sets the packing alignment for data structures. It affects all data structures declared after this pragma until you change it again with another pack pragma.
This pragma
|
Does this
|
#pragma pack(n)
|
Sets the alignment modulus to n, where n may be 1, 2, 4, 8 or 16. For MIPS compilers, if n is 0, structure alignment is reset to the default setting.
|
#pragma pack(push, n)
|
Pushes the current alignment modulus on a stack, then sets it to n, where n may be 1, 2, 4, 8 or 16. Use push and pop when you need a specific modulus for some declaration or set of declarations, but do not want to disturb the default setting. This form is not supported by the MIPS compilers.
|
#pragma pack(pop)
|
Pops a previously pushed alignment modulus from the stack. This form is not supported by the MIPS compilers.
|
#pragma pack()
|
For x86 compilers, resets alignment modulus to the value specified in the x86 CodeGen settings panel. For MIPS compilers, resets structure alignment to the default setting.
|
This pragma corresponds to the Byte Alignment option in the x86 CodeGen settings panel.
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 17, 2000