mirror of
https://github.com/FEX-Emu/FEX.git
synced 2024-12-15 09:59:28 +00:00
CPUInfo: Add mingw helper for CalculateNumberOfCPUs
This commit is contained in:
parent
a33443db62
commit
3ebe9f7b04
11
External/FEXCore/Source/Utils/CPUInfo.cpp
vendored
11
External/FEXCore/Source/Utils/CPUInfo.cpp
vendored
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user