https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61121
--- Comment #7 from Jim Michaels <jmichae3 at yahoo dot com> --- http://msdn.microsoft.com/en-us/library/windows/desktop/dd405485%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms679351%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms680582%28v=vs.85%29.aspx in windows, #if defined(_MSC_VER)||defined(__BORLANDC__)||defined(__MINGW32__) #include <windows.h> int64_t getmaxthreads(void) { DWORD numprocs=GetActiveProcessorCount(ALL_PROCESSOR_GROUPS); if (0==numprocs) { //ERROR. do something. DWORD lasterr=GetLastError(); //do something with error return 0;//failure } return numprocs-1; } #endif