CPUInfo: Add mingw helper for CalculateNumberOfCPUs

This commit is contained in:
Ryan Houdek 2023-04-15 18:29:06 -07:00
parent a33443db62
commit 3ebe9f7b04

View File

@ -4,9 +4,14 @@
#include <cstddef>
#include <cstdint>
#ifdef _WIN32
#include <thread>
#else
#include <linux/limits.h>
#endif
namespace FEXCore::CPUInfo {
#ifndef _WIN32
uint32_t CalculateNumberOfCPUs() {
char Tmp[PATH_MAX];
size_t CPUs = 1;
@ -21,4 +26,10 @@ namespace FEXCore::CPUInfo {
return CPUs;
}
#else
uint32_t CalculateNumberOfCPUs() {
// May not return correct number of cores if some are parked.
return std::thread::hardware_concurrency();
}
#endif
}