From 9fc17dc9e9e5aaf8d64bfb5a84206501f3b471ac Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 13 Mar 2017 21:33:09 +0000 Subject: [PATCH] Fix FreeBSD cycle starting for release compiler after FPSysCtl interface change git-svn-id: trunk@35575 - --- compiler/systems.pas | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/compiler/systems.pas b/compiler/systems.pas index bba3f1da12..7ae7bd2cc4 100644 --- a/compiler/systems.pas +++ b/compiler/systems.pas @@ -459,6 +459,21 @@ implementation {$ifdef FreeBSD} function GetOSRelDate:Longint; +{ FPSysCtl first argument was of type pchar + up to commit 35566 from 2017/03/11 + and corrected to pcint in that commit. + But the following code needs to work with + both old 3.0.X definition and new definition using pcint type. + Problem solved using a special type called + FPSysCtlFirstArgType. } +{$ifdef VER3_0} +type + FPSysCtlFirstArgType = PChar; +{$else} +type + FPSysCtlFirstArgType = pcint; +{$endif} + var mib : array[0..1] of cint; rval : cint; @@ -475,7 +490,7 @@ Begin mib[1] := KERN_OSRELDATE; len := 4; oerrno:= fpgeterrno; - if (FPsysctl(pChar(@mib), 2, pchar(@v), @len, NIL, 0) = -1) Then + if (FPsysctl(FPSysCtlFirstArgType(@mib), 2, pchar(@v), @len, NIL, 0) = -1) Then Begin if (fpgeterrno = ESysENOMEM) Then fpseterrno(oerrno);