Skip to content

An align after a record can be an expression #339

Description

@UweRaabe

Example from Winapi.Winsock2.pas:

type
  sockaddr_storage = record
    ss_family: word;              // Address family.
    __ss_pad1: array [0.._SS_PAD1SIZE - 1] of a_char;  // 6 byte pad, this is to make
                                   // implementation specific pad up to
                                   // alignment field that follows explicit
                                   // in the data structure.
    __ss_align: Int64;             // Field to force desired structure.
    __ss_pad2: array [0.._SS_PAD2SIZE - 1] of a_char;  // 112 byte pad to achieve desired size;
                                   // _SS_MAXSIZE value minus size of
                                   // ss_family, __ss_pad1, and
                                   // __ss_align fields is 112.
  end align (_SS_ALIGNSIZE);
  {$EXTERNALSYM sockaddr_storage}
  TSockAddrStorage = sockaddr_storage;
  PSockAddrStorage = ^sockaddr_storage;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions