From ba6b4bc67989585feb9ee019758f1247d0296c8d Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 3 Nov 2005 14:35:20 +0000 Subject: [PATCH] [project @ 2005-11-03 14:35:20 by simonmar] Modify ACQUIRE_LOCK/RELEASE_LOCK for use in .cmm files --- ghc/includes/OSThreads.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghc/includes/OSThreads.h b/ghc/includes/OSThreads.h index df65dcd..c136aa5 100644 --- a/ghc/includes/OSThreads.h +++ b/ghc/includes/OSThreads.h @@ -82,13 +82,15 @@ typedef DWORD ThreadLocalKey; #define INIT_MUTEX_VAR 0 #define INIT_COND_VAR 0 +// casting to (Mutex *) here required due to use in .cmm files where +// the argument has (void *) type. #define ACQUIRE_LOCK(mutex) \ - if (WaitForSingleObject(*mutex,INFINITE) == WAIT_FAILED) { \ + if (WaitForSingleObject(*((Mutex *)mutex),INFINITE) == WAIT_FAILED) { \ barf("WaitForSingleObject: %d", GetLastError()); \ } #define RELEASE_LOCK(mutex) \ - if (ReleaseMutex(*mutex) == 0) { \ + if (ReleaseMutex(*((Mutex *)mutex)) == 0) { \ barf("ReleaseMutex: %d", GetLastError()); \ } -- 1.7.10.4