aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/scicore/tools.c')
-rw-r--r--engines/sci/scicore/tools.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/sci/scicore/tools.c b/engines/sci/scicore/tools.c
index 11bc00d5a7..802a4f9db1 100644
--- a/engines/sci/scicore/tools.c
+++ b/engines/sci/scicore/tools.c
@@ -35,9 +35,25 @@
#ifdef _MSC_VER
# include <sys/timeb.h>
# include <windows.h>
-# include <sci_win32.h>
+# include <mmsystem.h>
# include <sys/types.h>
# include <sys/stat.h>
+# ifdef sleep
+# undef sleep
+# endif
+
+# define sleep(x) \
+ do { \
+ if (x == 0) { \
+ Sleep(0); \
+ } else { \
+ if (timeBeginPeriod(1) != TIMERR_NOERROR) \
+ fprintf(stderr, "timeBeginPeriod(1) failed\n"); \
+ Sleep(x); \
+ if (timeEndPeriod(1) != TIMERR_NOERROR) \
+ fprintf(stderr, "timeEndPeriod(1) failed\n"); \
+ } \
+ } while (0);
#else
#ifdef _WIN32
# include <windows.h>