summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system/threads.nim9
-rw-r--r--lib/system/timers.nim9
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index e32b77258..3f8387459 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -117,10 +117,11 @@ else:
     schedh = "#define _GNU_SOURCE\n#include <sched.h>"
     pthreadh = "#define _GNU_SOURCE\n#include <pthread.h>"
 
-  when defined(linux):
-    type Time = clong
-  else:
-    type Time = int
+  when not declared(Time):
+    when defined(linux):
+      type Time = clong
+    else:
+      type Time = int
 
   type
     SysThread* {.importc: "pthread_t", header: "<sys/types.h>",
diff --git a/lib/system/timers.nim b/lib/system/timers.nim
index 129a7d092..f2ebad2c1 100644
--- a/lib/system/timers.nim
+++ b/lib/system/timers.nim
@@ -78,10 +78,11 @@ elif defined(posixRealtime):
 
 else:
   # fallback Posix implementation:
-  when defined(linux):
-    type Time = clong
-  else:
-    type Time = int
+  when not declared(Time):
+    when defined(linux):
+      type Time = clong
+    else:
+      type Time = int
 
   type
     Timeval {.importc: "struct timeval", header: "<sys/select.h>",