From: <bor...@us...> - 2020-07-22 14:27:14
|
Revision: 3749 http://sourceforge.net/p/ftm/code/3749 Author: borghesi Date: 2020-07-22 14:27:12 +0000 (Wed, 22 Jul 2020) Log Message: ----------- Modified Paths: -------------- trunk/ftm/ftmlib/functions.c Modified: trunk/ftm/ftmlib/functions.c =================================================================== --- trunk/ftm/ftmlib/functions.c 2020-07-22 11:09:12 UTC (rev 3748) +++ trunk/ftm/ftmlib/functions.c 2020-07-22 14:27:12 UTC (rev 3749) @@ -978,6 +978,7 @@ _function_numcores (fts_object_t *o, fts_symbol_t s, int ac, const fts_atom_t *at, fts_atom_t *ret) { // todo: #ifdef HAVE_SYS_SYSCTL_H +#ifndef WIN32 int mib[2]; int ncpu, status; size_t intsize = sizeof(int); @@ -992,6 +993,14 @@ fts_set_int(ret, ncpu); return fts_ok; } +#else + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + int numCPU = sysinfo.dwNumberOfProcessors; + + fts_set_int(ret, numCPU); + return fts_ok; +#endif // #endif return fts_status_new(fts_new_symbol("can't get number of cores")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |