From: H.G.Muller Date: Wed, 11 Apr 2018 07:41:22 +0000 (+0200) Subject: Move #includes of system headers to top of file X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=15eea33f6b0d88386c6ea69d1d560483155ec2fc;p=crazywa.git Move #includes of system headers to top of file 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. --- diff --git a/dropper.c b/dropper.c index 5d521cf..3236717 100644 --- a/dropper.c +++ b/dropper.c @@ -9,6 +9,20 @@ #include #include +#ifdef WIN32 +# include +# define CPUtime 1000.*clock +#else +# include +# include +# include + 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 @@ -1715,20 +1729,6 @@ int ponder; int resign; // engine-defined option int contemptFactor; // likewise -#ifdef WIN32 -# include -# define CPUtime 1000.*clock -#else -# include -# include -# include - 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) {