From f341baeaa783fff4b50cec8757e3b7a85837bfd7 Mon Sep 17 00:00:00 2001 From: marcoonthegit Date: Mon, 22 Aug 2022 13:22:57 +0200 Subject: [PATCH] * fixed ambiguity between pipe(2) with two params and pipe(3) with one that broke -dFPC_USE_LIBC --- rtl/freebsd/unxfunc.inc | 2 +- rtl/unix/baseunix.pp | 1 + rtl/unix/bunxh.inc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rtl/freebsd/unxfunc.inc b/rtl/freebsd/unxfunc.inc index 4c10ec53b5..6c4f00856e 100644 --- a/rtl/freebsd/unxfunc.inc +++ b/rtl/freebsd/unxfunc.inc @@ -51,7 +51,7 @@ var pip : tfildes; flags : cint; begin - assignPipe:=fppipe(pip, 0); + assignPipe:=fppipe(pip); // default parameter adds 0, if necessary. This abstracts between pipe(2) and pipe(3) pipe_in:=pip[0]; pipe_out:=pip[1]; end; diff --git a/rtl/unix/baseunix.pp b/rtl/unix/baseunix.pp index a9e44b2380..0a52beea6a 100644 --- a/rtl/unix/baseunix.pp +++ b/rtl/unix/baseunix.pp @@ -13,6 +13,7 @@ **********************************************************************} Unit BaseUnix; +{$modeswitch defaultparameters} // on freebsd to make one (libc) and two parameter pipe transparent. Interface {$modeswitch out} diff --git a/rtl/unix/bunxh.inc b/rtl/unix/bunxh.inc index b305376970..80fa39cd15 100644 --- a/rtl/unix/bunxh.inc +++ b/rtl/unix/bunxh.inc @@ -35,7 +35,7 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds} Function FpChown (path : pChar; owner : TUid; group : TGid): cInt; Function FpUtime (path : pChar; times : putimbuf): cInt; {$if defined(freebsd)} - Function FpPipe (var fildes : tfildes; flags : cInt):cInt; + Function FpPipe (var fildes : tfildes; flags : cInt=0):cInt; {$else} Function FpPipe (var fildes : tfildes):cInt; {$endif}