Browse Source

Fix processor count detection with HW_NCPU

pooler 12 years ago
parent
commit
fd83783732
1 changed files with 2 additions and 2 deletions
  1. 2 2
      driver-cpu.c

+ 2 - 2
driver-cpu.c

@@ -744,10 +744,10 @@ static int cpu_autodetect()
 	}
 	}
 	#elif defined(_SC_NPROCESSORS_ONLN)
 	#elif defined(_SC_NPROCESSORS_ONLN)
 		num_processors = sysconf(_SC_NPROCESSORS_ONLN);
 		num_processors = sysconf(_SC_NPROCESSORS_ONLN);
-	#elif defined(HW_NCPU)
+	#elif defined(CTL_HW) && defined(HW_NCPU)
 		int req[] = { CTL_HW, HW_NCPU };
 		int req[] = { CTL_HW, HW_NCPU };
 		size_t len = sizeof(num_processors);
 		size_t len = sizeof(num_processors);
-		v = sysctl(req, 2, &num_processors, &len, NULL, 0);
+		sysctl(req, 2, &num_processors, &len, NULL, 0);
 	#else
 	#else
 		num_processors = 1;
 		num_processors = 1;
 	#endif /* !WIN32 */
 	#endif /* !WIN32 */