История изменений
Исправление abalakin, (текущая версия) :
У меня сделано так:
#ifdef WIN32
SYSTEM_INFO systemInfo;
GetSystemInfo(&systemInfo);
return systemInfo.dwNumberOfProcessors;
#elif defined (__APPLE__) || defined(__FreeBSD__)
int numProcessors = 1;
size_t size = sizeof(numProcessors);
sysctlbyname("hw.ncpu", &numProcessors, &size, NULL, 0);
return numProcessors;
#else
return get_nprocs_conf();
#endif
Исходная версия abalakin, :
У меня сделано так:
#ifdef WIN32 SYSTEM_INFO systemInfo; GetSystemInfo(&systemInfo); return systemInfo.dwNumberOfProcessors; #elif defined (__APPLE__) || defined(__FreeBSD__) int numProcessors = 1; size_t size = sizeof(numProcessors); sysctlbyname(«hw.ncpu», &numProcessors, &size, NULL, 0); return numProcessors; #else return get_nprocs_conf(); #endif