Skip to content

Commit 4381ea2

Browse files
committed
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.
1 parent f84f047 commit 4381ea2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/platform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef unsigned __int64 uint64_t;
4040

4141
#else
4242
# include <inttypes.h>
43+
# include <unistd.h> // Used by sysconf(_SC_NPROCESSORS_ONLN)
4344
#endif
4445

4546
#if !defined(_WIN32) && !defined(_WIN64) // Linux - Unix

0 commit comments

Comments
 (0)