summary refs log tree commit diff stats
path: root/lib/windows/winlean.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/windows/winlean.nim')
-rw-r--r--lib/windows/winlean.nim11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim
index 3e37b824c..6c480d03a 100644
--- a/lib/windows/winlean.nim
+++ b/lib/windows/winlean.nim
@@ -516,9 +516,6 @@ type
     fd_count*: cint # unsigned
     fd_array*: array[0..FD_SETSIZE-1, SocketHandle]
 
-  Timeval* = object
-    tv_sec*, tv_usec*: int32
-
   AddrInfo* = object
     ai_flags*: cint         ## Input flags.
     ai_family*: cint        ## Address family of socket.
@@ -531,6 +528,14 @@ type
 
   SockLen* = cuint
 
+when defined(cpp):
+  type
+    Timeval* {.importc: "timeval", header: "<time.h>".} = object
+      tv_sec*, tv_usec*: int32
+else:
+  type
+    Timeval* = object
+      tv_sec*, tv_usec*: int32
 
 var
   SOMAXCONN* {.importc, header: "winsock2.h".}: cint