From 54f6280d7659ce057a64cd9878a17c26065a7321 Mon Sep 17 00:00:00 2001 From: Luis Ricardo Date: Tue, 7 Oct 2014 17:02:50 -0400 Subject: Update cpuinfo.nim sys/types.h needed for macosx and freebsd sys/param.h needed for openbsd and netbsd --- lib/pure/concurrency/cpuinfo.nim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/pure') diff --git a/lib/pure/concurrency/cpuinfo.nim b/lib/pure/concurrency/cpuinfo.nim index dfa819f64..cd8e5b14a 100644 --- a/lib/pure/concurrency/cpuinfo.nim +++ b/lib/pure/concurrency/cpuinfo.nim @@ -18,15 +18,22 @@ when not defined(windows): when defined(linux): import linux + +when defined(freebsd) or defined(macosx): + {.emit:"#include ".} + +when defined(openbsd) or defined(netbsd): + {.emit:"#include ".} when defined(macosx) or defined(bsd): + {.emit:"#include ".} 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: "".} + importc: "sysctl".} proc countProcessors*(): int {.rtl, extern: "ncpi$1".} = ## returns the numer of the processors/cores the machine has. -- cgit 1.4.1-2-gfad0