summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPhilip Wernersbach <philip.wernersbach@gmail.com>2015-03-15 17:33:46 -0400
committerPhilip Wernersbach <philip.wernersbach@gmail.com>2015-03-15 17:33:46 -0400
commitf8d6d74368ea14403d1d455db30b669750e71651 (patch)
treed1231e16d37c3b6f85e79ee5bd2fba923616d028
parentfaad6ed67ffcb450c8ab5b2697c917990686f80a (diff)
downloadNim-f8d6d74368ea14403d1d455db30b669750e71651.tar.gz
Fix pthread_create binding when compiling in C++ mode.
C++ has different rules for void pointers, which causes the binding
to be invalid when compiling in C++ mode.
-rw-r--r--lib/system/threads.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index 81d9e5d73..d8e011ecb 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -127,7 +127,7 @@ else:
     importc, header: "<pthread.h>".}
 
   proc pthread_create(a1: var TSysThread, a2: var TPthread_attr,
-            a3: proc (x: pointer) {.noconv.}, 
+            a3: proc (x: pointer): pointer {.noconv.}, 
             a4: pointer): cint {.importc: "pthread_create", 
             header: "<pthread.h>".}
   proc pthread_join(a1: TSysThread, a2: ptr pointer): cint {.
@@ -315,7 +315,7 @@ when defined(windows):
     threadProcWrapperBody(closure)
     # implicitly return 0
 else:
-  proc threadProcWrapper[TArg](closure: pointer) {.noconv.} = 
+  proc threadProcWrapper[TArg](closure: pointer): pointer {.noconv.} = 
     threadProcWrapperBody(closure)
 {.pop.}