Fixed symbol conflict in the sockets module on Windows.
This commit is contained in:
parent
da609fc445
commit
f83881dd4e
1 changed files with 2 additions and 3 deletions
|
|
@ -1505,7 +1505,6 @@ proc sendTo*(socket: TSocket, address: string, port: TPort,
|
||||||
|
|
||||||
when defined(Windows):
|
when defined(Windows):
|
||||||
const
|
const
|
||||||
SOCKET_ERROR = -1
|
|
||||||
IOCPARM_MASK = 127
|
IOCPARM_MASK = 127
|
||||||
IOC_IN = int(-2147483648)
|
IOC_IN = int(-2147483648)
|
||||||
FIONBIO = int(IOC_IN or ((sizeof(int) and IOCPARM_MASK) shl 16) or
|
FIONBIO = int(IOC_IN or ((sizeof(int) and IOCPARM_MASK) shl 16) or
|
||||||
|
|
@ -1518,7 +1517,7 @@ when defined(Windows):
|
||||||
proc setBlocking(s: TSocket, blocking: bool) =
|
proc setBlocking(s: TSocket, blocking: bool) =
|
||||||
when defined(Windows):
|
when defined(Windows):
|
||||||
var mode = clong(ord(not blocking)) # 1 for non-blocking, 0 for blocking
|
var mode = clong(ord(not blocking)) # 1 for non-blocking, 0 for blocking
|
||||||
if SOCKET_ERROR == ioctlsocket(TWinSocket(s.fd), FIONBIO, addr(mode)):
|
if ioctlsocket(TWinSocket(s.fd), FIONBIO, addr(mode)) == -1:
|
||||||
OSError()
|
OSError()
|
||||||
else: # BSD sockets
|
else: # BSD sockets
|
||||||
var x: int = fcntl(s.fd, F_GETFL, 0)
|
var x: int = fcntl(s.fd, F_GETFL, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue