diff options
Diffstat (limited to 'src/threading/cpu.c')
-rw-r--r-- | src/threading/cpu.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/threading/cpu.c b/src/threading/cpu.c index 45671df..381abeb 100644 --- a/src/threading/cpu.c +++ b/src/threading/cpu.c @@ -1,6 +1,17 @@ +#ifdef _WIN32 +#include <windows.h> +#else #include <sys/sysinfo.h> +#endif int get_core_count() { - return get_nprocs(); +#ifdef _WIN32 + SYSTEM_INFO sysinfo; + GetSystemInfo( &sysinfo ); + + return sysinfo.dwNumberOfProcessors; +#else + return get_nprocs(); +#endif } |