From c64481a7eddfaf1b0984916212d0c452e557a652 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Fri, 24 Aug 2012 13:18:46 -0400 Subject: [PATCH] Some changes for OS/2 --- mdl/m_io_sockets.pas | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mdl/m_io_sockets.pas b/mdl/m_io_sockets.pas index 47a4509..a86b43c 100644 --- a/mdl/m_io_sockets.pas +++ b/mdl/m_io_sockets.pas @@ -394,7 +394,12 @@ End; Function TIOSocket.ReadBuf (Var Buf; Len: LongInt) : LongInt; Begin If FInBufPos = FInBufEnd Then Begin - FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT); + {$IFDEF OS2} + FInBufEnd := Winsock.Recv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT); + {$ELSE} + FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT); + {$ENDIF} + FInBufPos := 0; If FInBufEnd <= 0 Then Begin @@ -444,7 +449,7 @@ Begin Exit; End; -// Data := Ord(Not Block); +// Data := Ord(Not Block); // Result := ioctlSocket(FSocketHandle, FIONBIO, Data); End; @@ -541,7 +546,12 @@ Begin If fpListen(FSocketHandle, 5) = -1 Then Exit; Temp := SizeOf(SIN); - Sock := fpAccept(FSocketHandle, @SIN, @Temp); + + {$IFDEF OS2} + Sock := Winsock.Accept(FSocketHandle, @SIN, @Temp); + {$ELSE} + Sock := fpAccept(FSocketHandle, @SIN, @Temp); + {$ENDIF} If Sock = -1 Then Exit;