| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
you can use DELPHI_LINUX condition like {$IFNDEF DELPHI_LINUX}
var
i: longint;
{$ENDIF}
begin
{$IFDEF DELPHI_LINUX}
Result := SysUtils.StrToFloat(string(s), TFormatSettings.Invariant);
{$ELSE}
Val(string(s), Result, i);
if i <> 0 then raise Exception.Create(RPS_InvalidFloat);
{$ENDIF}
end;
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This fixes a Delphi Linux build failure in uPSUtils.StrToFloat.
On Delphi/Linux, the current implementation calls:
where Result is Extended. That fails to compile because Delphi Linux does not support Extended as a distinct floating-point target in this context.
The patch keeps the existing Val implementation for Windows and FPC, and uses SysUtils.StrToFloat with invariant format settings only for Delphi/Linux. That preserves PascalScript's dot-decimal parsing behavior without changing the existing non-Linux path.
Verification
Verified in a downstream Delphi 12 project where the current upstream uPSUtils.pas failed during a Linux64 build with:
After this change, the same downstream execute Linux64 Release build completes successfully.