]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Use string instead of std::string
[stockfish] / src / misc.cpp
index 1c16726e809bf11fd70887f0bd4cc8f8f0c82c40..ba4da56896fee0bb5b4a9d745d639c3721970e23 100644 (file)
@@ -1,7 +1,7 @@
 /*
   Stockfish, a UCI chess playing engine derived from Glaurung 2.1
   Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
-  Copyright (C) 2008 Marco Costalba
+  Copyright (C) 2008-2009 Marco Costalba
 
   Stockfish is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
 #  include <unistd.h>
 
 #else
+/*
+   (c) Copyright 1992 Eric Backus
 
+   This software may be used freely so long as this copyright notice is
+   left intact. There is no warrantee on this software.
+*/
 #  include <windows.h>
 #  include <time.h>
 #  include "dos.h"
-int gettimeofday(struct timeval * tp, struct timezone * tzp);
+
+static int gettimeofday(struct timeval* tp, struct timezone*)
+{
+    SYSTEMTIME systime;
+
+    if (tp)
+    {
+        struct tm tmrec;
+        time_t theTime = time(NULL);
+
+        tmrec = *localtime(&theTime);
+        tp->tv_sec = mktime(&tmrec);
+        GetLocalTime(&systime); /* system time */
+
+        tp->tv_usec = systime.wMilliseconds * 1000;
+    }
+    return 0;
+}
 
 #endif
 
@@ -59,8 +81,10 @@ static const string AppTag  = "";
 //// Variables
 ////
 
-long dbg_cnt0 = 0;
-long dbg_cnt1 = 0;
+bool Chess960;
+
+uint64_t dbg_cnt0 = 0;
+uint64_t dbg_cnt1 = 0;
 
 bool dbg_show_mean = false;
 bool dbg_show_hit_rate = false;