]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Stockfish 1.3 rc1
[stockfish] / src / misc.cpp
index 1c16726e809bf11fd70887f0bd4cc8f8f0c82c40..01b07743ea60f7f58471251e4103561cc3e2ba51 100644 (file)
 #  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
 
@@ -50,7 +71,7 @@ using namespace std;
 /// Version number. If this is left empty, the current date (in the format
 /// YYMMDD) is used as a version number.
 
-static const string EngineVersion = "";
+static const string EngineVersion = "1.3rc1";
 static const string AppName = "Stockfish";
 static const string AppTag  = "";