along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if defined(_MSC_VER)
+#if defined(_WIN32) || defined(_WIN64)
#define _CRT_SECURE_NO_DEPRECATE
#define NOMINMAX // disable macros min() and max()
#endif
#include <algorithm>
-#include <cassert>
-#include <cstdio>
#include <iomanip>
#include <iostream>
#include <sstream>
-#include "bitcount.h"
#include "misc.h"
#include "thread.h"
/// date (in the format YYMMDD) is used as a version number.
static const string Version = "";
-static const string Tag = "";
+static const string Tag = "";
/// engine_info() returns the full name of the current Stockfish version.
int system_time() {
-#if defined(_MSC_VER)
+#if defined(_WIN32) || defined(_WIN64)
struct _timeb t;
_ftime(&t);
return int(t.time * 1000 + t.millitm);
int cpu_count() {
-#if defined(_MSC_VER)
+#if defined(_WIN32) || defined(_WIN64)
SYSTEM_INFO s;
GetSystemInfo(&s);
return std::min(int(s.dwNumberOfProcessors), MAX_THREADS);
/// timed_wait() waits for msec milliseconds. It is mainly an helper to wrap
/// conversion from milliseconds to struct timespec, as used by pthreads.
-void timed_wait(WaitCondition* sleepCond, Lock* sleepLock, int msec) {
+void timed_wait(WaitCondition& sleepCond, Lock& sleepLock, int msec) {
-#if defined(_MSC_VER)
+#if defined(_WIN32) || defined(_WIN64)
int tm = msec;
#else
struct timeval t;
void prefetch(char* addr) {
-#if defined(__INTEL_COMPILER) || defined(__ICL)
+# if defined(__INTEL_COMPILER) || defined(__ICL)
// This hack prevents prefetches to be optimized away by
// Intel compiler. Both MSVC and gcc seems not affected.
__asm__ ("");
-#endif
+# endif
_mm_prefetch(addr, _MM_HINT_T2);
_mm_prefetch(addr+64, _MM_HINT_T2); // 64 bytes ahead