summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2012-12-23 14:31:16 +0000
committerDominik Picheta <dominikpicheta@googlemail.com>2012-12-23 14:31:16 +0000
commitf83881dd4e42edc3f6c2b3dfdbe661defa096c60 (patch)
tree7236c32d55d484d3dd3533ec6e0ea0c5cdf83796 /lib
parentda609fc4454a8e57cbdd9d0415bb7fed1f7d1ce1 (diff)
downloadNim-f83881dd4e42edc3f6c2b3dfdbe661defa096c60.tar.gz
Fixed symbol conflict in the sockets module on Windows.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/pure/sockets.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim
index 053c1711a..86f06324a 100755
--- a/lib/pure/sockets.nim
+++ b/lib/pure/sockets.nim
@@ -1504,8 +1504,7 @@ proc sendTo*(socket: TSocket, address: string, port: TPort,
   result = socket.sendTo(address, port, cstring(data), data.len)
 
 when defined(Windows):
-  const 
-    SOCKET_ERROR = -1
+  const
     IOCPARM_MASK = 127
     IOC_IN = int(-2147483648)
     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) =
   when defined(Windows):
     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()
   else: # BSD sockets
     var x: int = fcntl(s.fd, F_GETFL, 0)