summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorYuriy Glukhov <yutiy.glukhov@gmail.com>2016-03-04 00:08:47 +0200
committerYuriy Glukhov <yutiy.glukhov@gmail.com>2016-03-04 22:37:02 +0200
commit39e797080d4f4ad7494323365f6bf33709ac5ed6 (patch)
tree01b8cbf83838bc8ddbcb34119cfe62d5981daf3c /lib/system
parent3ae45691d294504d33be3d6a602a3b7217ff21de (diff)
downloadNim-39e797080d4f4ad7494323365f6bf33709ac5ed6.tar.gz
Fixed includes for pthread types.
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/syslocks.nim12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/system/syslocks.nim b/lib/system/syslocks.nim
index a91a5e7d4..1551a4121 100644
--- a/lib/system/syslocks.nim
+++ b/lib/system/syslocks.nim
@@ -74,11 +74,14 @@ when defined(Windows):
 else:
   type
     SysLock {.importc: "pthread_mutex_t", pure, final,
-               header: "<sys/types.h>".} = object
+               header: """#include <sys/types.h>
+                          #include <pthread.h>""".} = object
     SysLockAttr {.importc: "pthread_mutexattr_t", pure, final
-               header: "<sys/types.h>".} = object
+               header: """#include <sys/types.h>
+                          #include <pthread.h>""".} = object
     SysCond {.importc: "pthread_cond_t", pure, final,
-               header: "<sys/types.h>".} = object
+               header: """#include <sys/types.h>
+                          #include <pthread.h>""".} = object
     SysLockType = distinct cint
 
   proc SysLockType_Reentrant: SysLockType =
@@ -92,7 +95,7 @@ else:
 
   proc setSysLockType(a: var SysLockAttr, t: SysLockType) {.
     importc: "pthread_mutexattr_settype", header: "<pthread.h>", noSideEffect.}
-  
+
   proc acquireSys(L: var SysLock) {.noSideEffect,
     importc: "pthread_mutex_lock", header: "<pthread.h>".}
   proc tryAcquireSysAux(L: var SysLock): cint {.noSideEffect,
@@ -115,4 +118,3 @@ else:
 
   proc deinitSysCond(cond: var SysCond) {.noSideEffect,
     importc: "pthread_cond_destroy", header: "<pthread.h>".}
-