This commit is contained in:
iceman1001 2019-04-28 11:09:46 +02:00
commit 9779868753
9 changed files with 86 additions and 59 deletions

View file

@ -800,19 +800,19 @@ int num_CPUs(void) {
#elif defined(__linux__) && defined(_SC_NPROCESSORS_ONLN)
#include <unistd.h>
int count = sysconf(_SC_NPROCESSORS_ONLN);
if (count <= 0)
if (count <= 0)
count = 1;
return count;
return count;
#elif defined(__APPLE__)
/*
TODO ICEMAN 2019, its commented out until someone finds a better solution
/*
TODO ICEMAN 2019, its commented out until someone finds a better solution
#include "sys/sysctl.h"
uint32_t logicalcores = 0;
size_t size = sizeof( logicalcores );
sysctlbyname( "hw.logicalcpu", &logicalcores, &size, NULL, 0 );
return logicalcores;
*/
return 1;
uint32_t logicalcores = 0;
size_t size = sizeof( logicalcores );
sysctlbyname( "hw.logicalcpu", &logicalcores, &size, NULL, 0 );
return logicalcores;
*/
return 1;
#else
return 1;
#endif