|
|
@@ -82,7 +82,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
#ifdef OS_WINDOWS |
|
|
|
#include <windows.h> |
|
|
|
#endif |
|
|
|
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) |
|
|
|
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) |
|
|
|
#include <sys/types.h> |
|
|
|
#include <sys/sysctl.h> |
|
|
|
#endif |
|
|
@@ -1201,7 +1201,7 @@ static int get_num_cores(void) { |
|
|
|
|
|
|
|
#ifdef OS_WINDOWS |
|
|
|
SYSTEM_INFO sysinfo; |
|
|
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) |
|
|
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) |
|
|
|
int m[2], count; |
|
|
|
size_t len; |
|
|
|
#endif |
|
|
@@ -1215,7 +1215,7 @@ static int get_num_cores(void) { |
|
|
|
GetSystemInfo(&sysinfo); |
|
|
|
return sysinfo.dwNumberOfProcessors; |
|
|
|
|
|
|
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) |
|
|
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) |
|
|
|
m[0] = CTL_HW; |
|
|
|
m[1] = HW_NCPU; |
|
|
|
len = sizeof(int); |
|
|
|