mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 21:19:31 +02:00
- Remove INVALID_SOCKET and SOCKET_ERROR constants from fpwinsockh.inc,
because the socket unit routines use signed types. git-svn-id: trunk@6421 -
This commit is contained in:
parent
af466b4219
commit
3330a91e9e
@ -129,9 +129,13 @@ const
|
||||
|
||||
{ This is used instead of -1, since the
|
||||
TSocket type is unsigned.}
|
||||
|
||||
{
|
||||
Tsocket might be unsigned, but the sockets unit uses
|
||||
signed types. So, we cannot use these constants, signed
|
||||
ones are defined in socketh.inc.
|
||||
INVALID_SOCKET = winsock2.INVALID_SOCKET;
|
||||
SOCKET_ERROR = winsock2.SOCKET_ERROR;
|
||||
}
|
||||
|
||||
{ Option flags per-socket. }
|
||||
|
||||
|
@ -291,7 +291,7 @@ end;
|
||||
function fpWrite(handle : longint;Const bufptr;size : dword) : dword;
|
||||
begin
|
||||
fpWrite := dword(Winsock2.send(handle, bufptr, size, 0));
|
||||
if fpWrite = dword(SOCKET_ERROR) then
|
||||
if fpWrite = dword(winsock2.SOCKET_ERROR) then
|
||||
begin
|
||||
SocketError := WSAGetLastError;
|
||||
fpWrite := 0;
|
||||
@ -305,7 +305,7 @@ function fpRead(handle : longint;var bufptr;size : dword) : dword;
|
||||
d : dword;
|
||||
|
||||
begin
|
||||
if ioctlsocket(handle,FIONREAD,@d) = SOCKET_ERROR then
|
||||
if ioctlsocket(handle,FIONREAD,@d) = winsock2.SOCKET_ERROR then
|
||||
begin
|
||||
SocketError:=WSAGetLastError;
|
||||
fpRead:=0;
|
||||
@ -316,7 +316,7 @@ function fpRead(handle : longint;var bufptr;size : dword) : dword;
|
||||
if size>d then
|
||||
size:=d;
|
||||
fpRead := dword(Winsock2.recv(handle, bufptr, size, 0));
|
||||
if fpRead = dword(SOCKET_ERROR) then
|
||||
if fpRead = dword(winsock2.SOCKET_ERROR) then
|
||||
begin
|
||||
SocketError:= WSAGetLastError;
|
||||
fpRead := 0;
|
||||
|
Loading…
Reference in New Issue
Block a user