Skip to content

Commit 559e385

Browse files
committed
fix compilation issue when using FPC 3.0.4
1 parent 351f140 commit 559e385

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Libs/TermSignal/SigTermImpl.pas

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ implementation
6767
fpWrite(terminatePipeOut, ch, 1);
6868
end;
6969

70+
{$IF FPC_FULLVERSION <= 30004}
71+
//workaround for bug 27414 in FPC 3.0.4
72+
//https://gitlab.com/freepascal.org/fpc/source/-/issues/27414
73+
procedure __doTerminate(sig : longint; info : PSigInfo; ctx : PSigContext); cdecl;
74+
begin
75+
TSigTerm.doTerminate(sig, info, ctx);
76+
end;
77+
{$ENDIF}
78+
7079
(*!-----------------------------------------------
7180
* install signal handler
7281
*-------------------------------------------------
@@ -77,7 +86,11 @@ implementation
7786
begin
7887
fillChar(newAct, sizeOf(SigactionRec), #0);
7988
fillChar(oldAct, sizeOf(Sigactionrec), #0);
89+
{$IF FPC_FULLVERSION <= 30004}
90+
newAct.sa_handler := @__doTerminate;
91+
{$ELSE}
8092
newAct.sa_handler := @TSigTerm.doTerminate;
93+
{$ENDIF}
8194
fpSigaction(aSig, @newAct, @oldAct);
8295
end;
8396

src/Router/NullRouteArgsImpl.pas

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ implementation
7777
*--------------------------------------------*)
7878
function TNullRouteArgs.getArgs() : TArrayOfPlaceholders;
7979
begin
80-
result := [];
80+
//bugfix for FPC 3.0.4
81+
{$IF FPC_FULLVERSION > 30004}
82+
result := [];
83+
{$ELSE}
84+
result := nil;
85+
{$ENDIF}
8186
end;
8287

8388
(*!-------------------------------------------

0 commit comments

Comments
 (0)