mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 07:29:35 +01:00
tweak code to work with darwin
git-svn-id: trunk@8275 -
This commit is contained in:
parent
87bb2cef8b
commit
10b74e3eb0
@ -70,6 +70,11 @@ end;
|
||||
|
||||
uses BaseUnix, TermIO;
|
||||
|
||||
{$ifdef DARWIN}
|
||||
const
|
||||
FIONREAD = $4004667;
|
||||
{$endif}
|
||||
|
||||
function TAsyncProcess.GetNumBytesAvailable: dword;
|
||||
begin
|
||||
if not (poUsePipes in Options) then
|
||||
@ -79,7 +84,7 @@ begin
|
||||
// FIONSPACE -> bytes available for writing without blocking
|
||||
// does not work on all platforms (not defined on linux e.g.)
|
||||
{$ifdef UseLinuxThreading}
|
||||
if fpioctl(Output.Handle, $4004667f, @Result) = -1 then
|
||||
if fpioctl(Output.Handle, FIONREAD, @Result) = -1 then
|
||||
{$ENDIF}
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
@ -137,8 +137,13 @@ var
|
||||
threadsync_giochannel: pgiochannel;
|
||||
childsig_pending: boolean;
|
||||
|
||||
{$ifdef DARWIN}
|
||||
procedure ChildEventHandler(sig: longint; var siginfo: tsiginfo_t;
|
||||
var sigcontext: sigcontextrec); cdecl;
|
||||
{$else}
|
||||
procedure ChildEventHandler(sig: longint; siginfo: psiginfo;
|
||||
sigcontext: psigcontext); cdecl;
|
||||
{$endif}
|
||||
begin
|
||||
childsig_pending := true;
|
||||
WakeMainThread(nil);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user