From c856b0337e03ec6ef848a1eae6f33c2071683133 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 13 Sep 2011 19:46:36 +0200 Subject: [PATCH] Make DoSleep front-end wrapper for msec sleep DoSleep was #defined as a macro for Sleep/ sleep, with an argument indicating msec in WinBoard, but seconds in XBoard. Nuw it universally uses msec, by defining it as a wrapperin the respective front-ends. (For XBoard itwraps FrameDelay.) --- backend.c | 3 --- frontend.h | 1 + winboard/winboard.c | 6 ++++++ xboard.c | 6 ++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index 9f58b18..cb36909 100644 --- a/backend.c +++ b/backend.c @@ -55,8 +55,6 @@ #ifdef WIN32 #include -#define DoSleep( n ) if( (n) != 0 ) Sleep( (n) ); - int flock(int f, int code); #define LOCK_EX 2 #define SLASH '\\' @@ -64,7 +62,6 @@ int flock(int f, int code); #else #include -#define DoSleep( n ) if( (n) >= 0) sleep(n) #define SLASH '/' #endif diff --git a/frontend.h b/frontend.h index ec0a4ea..1c32c35 100644 --- a/frontend.h +++ b/frontend.h @@ -111,6 +111,7 @@ void EchoOff P((void)); void Raw P((void)); void Colorize P((ColorClass cc, int continuation)); char *InterpretFileName P((char *name, char *dir)); +void DoSleep P((int n)); char *UserName P((void)); char *HostName P((void)); diff --git a/winboard/winboard.c b/winboard/winboard.c index 83fd4bd..7c97f6c 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -9619,6 +9619,12 @@ OutputToProcess(ProcRef pr, char *message, int count, int *outError) return outCount; } +void +DoSleep(int n) +{ + if(n != 0) Sleep(n); +} + int OutputToProcessDelayed(ProcRef pr, char *message, int count, int *outError, long msdelay) diff --git a/xboard.c b/xboard.c index 21bc9bb..a0fa9b6 100644 --- a/xboard.c +++ b/xboard.c @@ -8226,6 +8226,12 @@ FrameDelay (time) #endif +void +DoSleep(int n) +{ + FrameDelay(n); +} + /* Convert board position to corner of screen rect and color */ static void -- 1.7.0.4