Including system headers after having #defined other stuff sometimes gives
problems, if the header uses variables with names equal to a macro. Use of
names not starting with '_' should be consiered a bug in the header, but
it happens. To guard against this the platform-dependent time reading
was moved to the beginning of the file.
#include <stdlib.h>
#include <string.h>
+#ifdef WIN32
+# include <windows.h>
+# define CPUtime 1000.*clock
+#else
+# include <sys/time.h>
+# include <sys/times.h>
+# include <unistd.h>
+ int GetTickCount() // with thanks to Tord
+ { struct timeval t;
+ gettimeofday(&t, NULL);
+ return t.tv_sec*1000 + t.tv_usec/1000;
+ }
+#endif
+
#define DEBUG 0
#define IDQS /* Iteratively deepening QS */
#define LMR 2
int resign; // engine-defined option
int contemptFactor; // likewise
-#ifdef WIN32
-# include <windows.h>
-# define CPUtime 1000.*clock
-#else
-# include <sys/time.h>
-# include <sys/times.h>
-# include <unistd.h>
- int GetTickCount() // with thanks to Tord
- { struct timeval t;
- gettimeofday(&t, NULL);
- return t.tv_sec*1000 + t.tv_usec/1000;
- }
-#endif
-
int
ReadClock (int start)
{