Skip to content

Commit

Permalink
fix compilation issue when using FPC 3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zamronypj committed Feb 17, 2022
1 parent 351f140 commit 559e385
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/Libs/TermSignal/SigTermImpl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ implementation
fpWrite(terminatePipeOut, ch, 1);
end;

{$IF FPC_FULLVERSION <= 30004}
//workaround for bug 27414 in FPC 3.0.4
//https://gitlab.com/freepascal.org/fpc/source/-/issues/27414
procedure __doTerminate(sig : longint; info : PSigInfo; ctx : PSigContext); cdecl;
begin
TSigTerm.doTerminate(sig, info, ctx);
end;
{$ENDIF}

(*!-----------------------------------------------
* install signal handler
*-------------------------------------------------
Expand All @@ -77,7 +86,11 @@ implementation
begin
fillChar(newAct, sizeOf(SigactionRec), #0);
fillChar(oldAct, sizeOf(Sigactionrec), #0);
{$IF FPC_FULLVERSION <= 30004}
newAct.sa_handler := @__doTerminate;
{$ELSE}
newAct.sa_handler := @TSigTerm.doTerminate;
{$ENDIF}
fpSigaction(aSig, @newAct, @oldAct);
end;

Expand Down
7 changes: 6 additions & 1 deletion src/Router/NullRouteArgsImpl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ implementation
*--------------------------------------------*)
function TNullRouteArgs.getArgs() : TArrayOfPlaceholders;
begin
result := [];
//bugfix for FPC 3.0.4
{$IF FPC_FULLVERSION > 30004}
result := [];
{$ELSE}
result := nil;
{$ENDIF}
end;

(*!-------------------------------------------
Expand Down

0 comments on commit 559e385

Please sign in to comment.