- 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:
daniel 2007-02-11 13:42:46 +00:00
parent af466b4219
commit 3330a91e9e
2 changed files with 8 additions and 4 deletions

View File

@ -129,9 +129,13 @@ const
{ This is used instead of -1, since the { This is used instead of -1, since the
TSocket type is unsigned.} 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; INVALID_SOCKET = winsock2.INVALID_SOCKET;
SOCKET_ERROR = winsock2.SOCKET_ERROR; SOCKET_ERROR = winsock2.SOCKET_ERROR;
}
{ Option flags per-socket. } { Option flags per-socket. }

View File

@ -291,7 +291,7 @@ end;
function fpWrite(handle : longint;Const bufptr;size : dword) : dword; function fpWrite(handle : longint;Const bufptr;size : dword) : dword;
begin begin
fpWrite := dword(Winsock2.send(handle, bufptr, size, 0)); fpWrite := dword(Winsock2.send(handle, bufptr, size, 0));
if fpWrite = dword(SOCKET_ERROR) then if fpWrite = dword(winsock2.SOCKET_ERROR) then
begin begin
SocketError := WSAGetLastError; SocketError := WSAGetLastError;
fpWrite := 0; fpWrite := 0;
@ -305,7 +305,7 @@ function fpRead(handle : longint;var bufptr;size : dword) : dword;
d : dword; d : dword;
begin begin
if ioctlsocket(handle,FIONREAD,@d) = SOCKET_ERROR then if ioctlsocket(handle,FIONREAD,@d) = winsock2.SOCKET_ERROR then
begin begin
SocketError:=WSAGetLastError; SocketError:=WSAGetLastError;
fpRead:=0; fpRead:=0;
@ -316,7 +316,7 @@ function fpRead(handle : longint;var bufptr;size : dword) : dword;
if size>d then if size>d then
size:=d; size:=d;
fpRead := dword(Winsock2.recv(handle, bufptr, size, 0)); fpRead := dword(Winsock2.recv(handle, bufptr, size, 0));
if fpRead = dword(SOCKET_ERROR) then if fpRead = dword(winsock2.SOCKET_ERROR) then
begin begin
SocketError:= WSAGetLastError; SocketError:= WSAGetLastError;
fpRead := 0; fpRead := 0;