ref: 1e4e7a54f3164eff3564502e57640036121add54
parent: 51e92acb3c80242155d047b42c72a1e83cbd150d
author: zamfofex <zamfofex@twdb.moe>
date: Thu Dec 21 07:14:48 EST 2023
do not rely on ‘_SC_NPROCESSORS_ONLN’ being available
--- a/search.c
+++ b/search.c
@@ -94,8 +94,10 @@
#ifdef __MINGW32__
GetSystemInfo(&info);
ctx->cpu_count = info.dwNumberOfProcessors;
-#else
+#elif defined(_SC_NPROCESSORS_ONLN)
ctx->cpu_count = sysconf(_SC_NPROCESSORS_ONLN);
+#else
+ ctx->cpu_count = 4;
#endif
if (ctx->cpu_count <= 0)
{--
⑨