summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-10-11 21:44:35 +0200
committerAraq <rumpf_a@web.de>2014-10-11 21:44:35 +0200
commit399c985b62b35e7d81149ceef5d9a51fdeac35ed (patch)
treec0e1b5207f37c580e5ac86eb11aabe334207137e /lib/pure
parent826d529256a51f15942685e6533faf5040605d18 (diff)
downloadNim-399c985b62b35e7d81149ceef5d9a51fdeac35ed.tar.gz
fixes recent regression
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/concurrency/cpuinfo.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pure/concurrency/cpuinfo.nim b/lib/pure/concurrency/cpuinfo.nim
index bd10a416f..8d7f28f8e 100644
--- a/lib/pure/concurrency/cpuinfo.nim
+++ b/lib/pure/concurrency/cpuinfo.nim
@@ -26,13 +26,16 @@ when defined(openbsd) or defined(netbsd):
   {.emit:"#include <sys/param.h>".}
 
 when defined(macosx) or defined(bsd):
+  # we HAVE to emit param.h before sysctl.h so we cannot use .header here
+  # either. The amount of archaic bullshit in Poonix based OSes is just insane.
+  {.emit:"#include <sys/sysctl.h>".}
   const
     CTL_HW = 6
     HW_AVAILCPU = 25
     HW_NCPU = 3
   proc sysctl(x: ptr array[0..3, cint], y: cint, z: pointer,
               a: var csize, b: pointer, c: int): cint {.
-              importc: "sysctl", header: "<sys/sysctl.h>".}
+              importc: "sysctl", nodecl.}
 
 proc countProcessors*(): int {.rtl, extern: "ncpi$1".} =
   ## returns the numer of the processors/cores the machine has.