Skip to content

Should we use unit ctypes for FPC? #26

Description

I wonder,

in sdlstd.inc we define all the types used in SDL2. We lead them back to basic Pascal types. In this example we lead UInt16 back to Word.

PUInt16 = ^UInt16;
UInt16 = Word;

I suggest to have a conditional type conversion bound to the ctypes unit for Free Pascal.

{$IFDEF FPC}
  UInt16 = cuint16;
{$ELSE}
  UInt16 = Word;
{$ENDIF}

The advantage is that type sizes should be chosen even more reliably for different platforms (at least in case of FPC).

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions