From: Marco Costalba Date: Thu, 25 Apr 2013 08:56:56 +0000 (+0200) Subject: Fix cpu_count() on some platforms X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=4381ea23feb33831ebe889e30645e10cf7032530 Fix cpu_count() on some platforms When we use sysconf(_SC_NPROCESSORS_ONLN) to get number of cores, we have to include sysconf library that is unistd.h Sometimes it happens to work just becuase unistd.h indirectly included by some other libraries, but not always. Reported and fixed by Eyal BD No functional change. --- diff --git a/src/platform.h b/src/platform.h index 36494c13..ad02575b 100644 --- a/src/platform.h +++ b/src/platform.h @@ -40,6 +40,7 @@ typedef unsigned __int64 uint64_t; #else # include +# include // Used by sysconf(_SC_NPROCESSORS_ONLN) #endif #if !defined(_WIN32) && !defined(_WIN64) // Linux - Unix