summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-10-10 00:39:10 +0200
committerAraq <rumpf_a@web.de>2013-10-10 00:39:10 +0200
commit67e9f2861e3e3139d26b2b0aba4c16508f3111a3 (patch)
tree387f167a04bd13aa756446e02dbc65acc39022d4 /lib
parent96529063bf08cb4e62a39d50e3c0cf167e50bd36 (diff)
downloadNim-67e9f2861e3e3139d26b2b0aba4c16508f3111a3.tar.gz
some fixes for win64
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/sockets.nim4
-rw-r--r--lib/system.nim9
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim
index fe4d3c2a4..c8a4171ab 100644
--- a/lib/pure/sockets.nim
+++ b/lib/pure/sockets.nim
@@ -1605,8 +1605,8 @@ when defined(Windows):
   const
     IOCPARM_MASK = 127
     IOC_IN = int(-2147483648)
-    FIONBIO = int(IOC_IN or ((sizeof(int) and IOCPARM_MASK) shl 16) or 
-                             (102 shl 8) or 126)
+    FIONBIO = IOC_IN.int32 or ((sizeof(int32) and IOCPARM_MASK) shl 16) or 
+                             (102 shl 8) or 126
 
   proc ioctlsocket(s: TWinSocket, cmd: clong, 
                    argptr: ptr clong): cint {.
diff --git a/lib/system.nim b/lib/system.nim
index 51f325997..174912519 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -998,6 +998,13 @@ type
     ## compiler supports. Currently this is ``float64``, but it is
     ## platform-dependant in general.
 
+when defined(windows):
+  type clong* {.importc: "long", nodecl.} = int32
+    ## This is the same as the type ``long`` in *C*.
+else:
+  type clong* {.importc: "long", nodecl.} = int
+    ## This is the same as the type ``long`` in *C*.
+
 type # these work for most platforms:
   cchar* {.importc: "char", nodecl.} = char
     ## This is the same as the type ``char`` in *C*.
@@ -1009,8 +1016,6 @@ type # these work for most platforms:
     ## This is the same as the type ``int`` in *C*.
   csize* {.importc: "size_t", nodecl.} = int
     ## This is the same as the type ``size_t`` in *C*.
-  clong* {.importc: "long", nodecl.} = int
-    ## This is the same as the type ``long`` in *C*.
   clonglong* {.importc: "long long", nodecl.} = int64
     ## This is the same as the type ``long long`` in *C*.
   cfloat* {.importc: "float", nodecl.} = float32