summary refs log tree commit diff stats
path: root/lib/system/timers.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/timers.nim')
-rw-r--r--lib/system/timers.nim9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/system/timers.nim b/lib/system/timers.nim
index 8aa4505c4..129a7d092 100644
--- a/lib/system/timers.nim
+++ b/lib/system/timers.nim
@@ -78,11 +78,16 @@ elif defined(posixRealtime):
 
 else:
   # fallback Posix implementation:
+  when defined(linux):
+    type Time = clong
+  else:
+    type Time = int
+
   type
     Timeval {.importc: "struct timeval", header: "<sys/select.h>",
                final, pure.} = object ## struct timeval
-      tv_sec: int  ## Seconds.
-      tv_usec: int ## Microseconds.
+      tv_sec: Time  ## Seconds.
+      tv_usec: clong ## Microseconds.
   {.deprecated: [Ttimeval: Timeval].}
   proc posix_gettimeofday(tp: var Timeval, unused: pointer = nil) {.
     importc: "gettimeofday", header: "<sys/time.h>".}