summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2018-04-06 16:07:36 +0800
committerAndreas Rumpf <rumpf_a@web.de>2018-04-06 10:07:36 +0200
commit4d6456d029964153cc9cb99a06ebbe13ffb15ef5 (patch)
treecdd316aa618dc162f2636d89ae0930be3645c243
parente336e6609c496502c3c2a209f85eb3e0a3a48ea9 (diff)
downloadNim-4d6456d029964153cc9cb99a06ebbe13ffb15ef5.tar.gz
__NR_gettid as const on amd64 (#7460)
-rw-r--r--lib/system/threads.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index f61cc4280..2c10e0244 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -642,7 +642,10 @@ when defined(windows):
 
 elif defined(linux):
   proc syscall(arg: clong): clong {.varargs, importc: "syscall", header: "<unistd.h>".}
-  var NR_gettid {.importc: "__NR_gettid", header: "<sys/syscall.h>".}: int
+  when defined(amd64):
+    const NR_gettid = clong(186)
+  else:
+    var NR_gettid {.importc: "__NR_gettid", header: "<sys/syscall.h>".}: clong
 
   proc getThreadId*(): int =
     ## get the ID of the currently running thread.