From c90a2c9ea1644507c0993513d1fc7925e19b4ea8 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 31 Aug 2022 13:30:01 +0200 Subject: windows implementation for get_core_count() --- src/threading/cpu.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/threading') 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 +#else #include +#endif int get_core_count() { - return get_nprocs(); +#ifdef _WIN32 + SYSTEM_INFO sysinfo; + GetSystemInfo( &sysinfo ); + + return sysinfo.dwNumberOfProcessors; +#else + return get_nprocs(); +#endif } -- cgit v1.2.3