diff --git a/lib/system/threads.nim b/lib/system/threads.nim index e32b772588..3f83874594 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -117,10 +117,11 @@ else: schedh = "#define _GNU_SOURCE\n#include " pthreadh = "#define _GNU_SOURCE\n#include " - 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: "", diff --git a/lib/system/timers.nim b/lib/system/timers.nim index 129a7d0929..f2ebad2c1b 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: "",