Difference between revisions of "$Bitpacking"

From Free Pascal wiki
Jump to navigationJump to search
(English translation of German page)
 
m (Trev moved page sBitpacking to $Bitpacking without leaving a redirect: Dollar signs work in page titles)
 
(No difference)

Latest revision as of 12:06, 26 February 2020

Deutsch (de) English (en)


Back to local compiler directives.


The local compiler directive $BITPACKING:

  • is used to compress records;
  • knows the switches ON and OFF;
  • tells the compiler whether it should use bitpacking or not when it encounters the Packed keyword for a structured type.

Example:

...
{$BITPACKING ON}
...
Type
   TMyRecord = packed record
     B1, B2, B3, B4 : Boolean;
   end;
Note-icon.png

Note: 1. The local compiler directive $BITPACKING is ignored in MacPas compiler mode. In the MacPas compiler mode, all packed records are aligned to bit addresses.
2. The reserved word Bitpacked can force alignment to bit addresses, regardless of the $BITPACKING directive and regardless of the $MODE.

See also