projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
f84f047
)
Fix cpu_count() on some platforms
author
Marco Costalba
<mcostalba@gmail.com>
Thu, 25 Apr 2013 08:56:56 +0000 (10:56 +0200)
committer
Marco Costalba
<mcostalba@gmail.com>
Thu, 25 Apr 2013 08:56:56 +0000 (10:56 +0200)
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.
src/platform.h
patch
|
blob
|
history
diff --git
a/src/platform.h
b/src/platform.h
index
36494c1
..
ad02575
100644
(file)
--- a/
src/platform.h
+++ b/
src/platform.h
@@
-40,6
+40,7
@@
typedef unsigned __int64 uint64_t;
#else
# include <inttypes.h>
+# include <unistd.h> // Used by sysconf(_SC_NPROCESSORS_ONLN)
#endif
#if !defined(_WIN32) && !defined(_WIN64) // Linux - Unix