From 01084b6a95bd991aa227977e96c9aa1b8e08ef85 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Thu, 15 Nov 2012 20:33:02 +0000 Subject: [PATCH] win32: Fix warnings relating to definition of LONG and use of InterlockedCompareExchange --- platform/win32/functions/threads/mtx_lock.c | 2 +- platform/win32/functions/threads/mtx_timedlock.c | 2 +- platform/win32/functions/threads/mtx_trylock.c | 2 +- platform/win32/internals/_PDCLIB_threadconfig.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/win32/functions/threads/mtx_lock.c b/platform/win32/functions/threads/mtx_lock.c index 59e716d..d16a487 100644 --- a/platform/win32/functions/threads/mtx_lock.c +++ b/platform/win32/functions/threads/mtx_lock.c @@ -6,7 +6,7 @@ int mtx_lock(mtx_t *mtx) { DWORD myId = GetCurrentThreadId(); - if(mtx->_ThreadId == myId) { + if(mtx->_ThreadId == (long) myId) { mtx->_NestCount++; return thrd_success; } diff --git a/platform/win32/functions/threads/mtx_timedlock.c b/platform/win32/functions/threads/mtx_timedlock.c index 07edc0c..5c1ffb3 100644 --- a/platform/win32/functions/threads/mtx_timedlock.c +++ b/platform/win32/functions/threads/mtx_timedlock.c @@ -8,7 +8,7 @@ int mtx_timedlock(mtx_t *_PDCLIB_restrict mtx, { DWORD myId = GetCurrentThreadId(); - if(mtx->_ThreadId == myId) { + if(mtx->_ThreadId == (long) myId) { mtx->_NestCount++; return thrd_success; } diff --git a/platform/win32/functions/threads/mtx_trylock.c b/platform/win32/functions/threads/mtx_trylock.c index ebc5e85..c5fce0e 100644 --- a/platform/win32/functions/threads/mtx_trylock.c +++ b/platform/win32/functions/threads/mtx_trylock.c @@ -6,7 +6,7 @@ int mtx_trylock(mtx_t *mtx) { DWORD myId = GetCurrentThreadId(); - if(mtx->_ThreadId == myId) { + if(mtx->_ThreadId == (long) myId) { mtx->_NestCount++; return thrd_success; } diff --git a/platform/win32/internals/_PDCLIB_threadconfig.h b/platform/win32/internals/_PDCLIB_threadconfig.h index c311867..0f35d29 100644 --- a/platform/win32/internals/_PDCLIB_threadconfig.h +++ b/platform/win32/internals/_PDCLIB_threadconfig.h @@ -20,7 +20,7 @@ void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void)); struct _PDCLIB_mtx { void * _WaitEvHandle; - volatile unsigned long _ThreadId; + volatile long _ThreadId; volatile unsigned int _NestCount; }; -- 2.40.0