Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the pcsize_t. #87

Closed
achinastone opened this issue Nov 12, 2022 · 4 comments · Fixed by #89
Closed

Where is the pcsize_t. #87

achinastone opened this issue Nov 12, 2022 · 4 comments · Fixed by #89

Comments

@achinastone
Copy link

I try to compile the units in Delphi, report error as follow:

[dcc32 Error] sdlrwops.inc(220): E2003 Undeclared identifier: 'pcsize_t'
[dcc32 Error] sdlrwops.inc(236): E2005 'pcsize_t' is not a type identifier
[dcc32 Error] ctypes.inc(94): E2240 $EXTERNALSYM and $NODEFINE not allowed for 'SIZE_T'; only global symbols
[dcc32 Fatal Error] SDL2Sample.dpr(9): F2063 Could not compile used unit 'sdl2.pas'
Failed

@suve
Copy link
Collaborator

suve commented Nov 12, 2022

Hi. Truth be told, most of us are using the Free Pascal Compiler, so Delphi compatibility is a bit untested. Looking at sdl2.pas, we probably goofed up, because the ctypes unit is included only when {$IFDEF FPC} is satisfied. Can you edit this part of the code (I assume that, since you're using Delphi, you're building for Windows) so the ctypes unit is always included and check if that fixes the issue?

@achinastone
Copy link
Author

I can't find pcsize_t in ctypes.inc.

@suve
Copy link
Collaborator

suve commented Nov 13, 2022

  {$IFNDEF WIN64}
    csize_t = cuint32;
  {$ELSE}
    csize_t = cuint64;
  {$ENDIF}

Just add pcsize_t = ^csize_t to ctypes.inc.

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

@achinastone Thanks for the report. As @suve mentioned, as Delphi support is not 100% guaranted, any report leading to better Delphi compatibility is highly desired.

Btw.: This issue is strongly related to the discussion #67.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants