aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/tools.c
diff options
context:
space:
mode:
authorPaweł Kołodziejski2009-02-15 09:56:04 +0000
committerPaweł Kołodziejski2009-02-15 09:56:04 +0000
commit311344b4451894120fa4688e431c67d5f08bd2fe (patch)
tree8372dd946fd954d439f2efb2509e8c336a66b0a8 /engines/sci/scicore/tools.c
parent06b5b22a8cae7eb8baad17c280383c37e699e2de (diff)
downloadscummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.tar.gz
scummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.tar.bz2
scummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.zip
fixed msvc9 compilation
svn-id: r38208
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>