summary refs log tree commit diff stats
path: root/lib/pure/concurrency/cpuinfo.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/concurrency/cpuinfo.nim')
-rw-r--r--lib/pure/concurrency/cpuinfo.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pure/concurrency/cpuinfo.nim b/lib/pure/concurrency/cpuinfo.nim
index dfa819f64..bd10a416f 100644
--- a/lib/pure/concurrency/cpuinfo.nim
+++ b/lib/pure/concurrency/cpuinfo.nim
@@ -18,6 +18,12 @@ when not defined(windows):
 
 when defined(linux):
   import linux
+  
+when defined(freebsd) or defined(macosx):
+  {.emit:"#include <sys/types.h>".}
+
+when defined(openbsd) or defined(netbsd):
+  {.emit:"#include <sys/param.h>".}
 
 when defined(macosx) or defined(bsd):
   const
@@ -26,7 +32,7 @@ when defined(macosx) or defined(bsd):
     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", header: "<sys/sysctl.h>".}
 
 proc countProcessors*(): int {.rtl, extern: "ncpi$1".} =
   ## returns the numer of the processors/cores the machine has.