Skip to content

Fix FPC compilation of uPSRuntime#313

Open
TetzkatLipHoka wants to merge 1 commit into
remobjects:masterfrom
TetzkatLipHoka:fix/fpc-compilation
Open

Fix FPC compilation of uPSRuntime#313
TetzkatLipHoka wants to merge 1 commit into
remobjects:masterfrom
TetzkatLipHoka:fix/fpc-compilation

Conversation

@TetzkatLipHoka

Copy link
Copy Markdown

Free Pascal 3.2.2 could not compile uPSRuntime.pas:

  • Inc()/Dec() on a Variant is a Delphi extension; FPC rejects it
    ('Operator is not overloaded'). Use := Variant +/- 1 instead, which is
    semantically identical and compiles on both.
  • ResultAsRegister was recently added to the interface section, but its
    implementation sits inside the {$else} region of empty_methods_handler.
    FPC on cpu64/arm/powerpc defines empty_methods_handler, so the whole
    region - including the implementation - disappeared and the unit failed
    with 'Forward declaration not solved'. Move the implementation in front
    of the region; it is plain Pascal with no dependency on the handlers.

Repro: fpc 3.2.2 x86_64-linux fails on master with 4 errors + 1 fatal;
with this change all uPS* core units compile and a script compile/run
smoke test passes on Linux. No change for Delphi (verified DCC32/DCC64).

🤖 Generated with Claude Code

Free Pascal 3.2.2 could not compile uPSRuntime.pas:

- Inc()/Dec() on a Variant is a Delphi extension; FPC rejects it
  ('Operator is not overloaded'). Use := Variant +/- 1 instead, which is
  semantically identical and compiles on both.
- ResultAsRegister was recently added to the interface section, but its
  implementation sits inside the {$else} region of empty_methods_handler.
  FPC on cpu64/arm/powerpc defines empty_methods_handler, so the whole
  region - including the implementation - disappeared and the unit failed
  with 'Forward declaration not solved'. Move the implementation in front
  of the region; it is plain Pascal with no dependency on the handlers.

Repro: fpc 3.2.2 x86_64-linux fails on master with 4 errors + 1 fatal;
with this change all uPS* core units compile and a script compile/run
smoke test passes on Linux. No change for Delphi (verified DCC32/DCC64).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 this pull request may close these issues.

1 participant