From: Martin Willi Date: Thu, 2 Jan 2014 17:14:51 +0000 (+0100) Subject: windows: Include for Vista instead of defining CondVar/SRWLock functions ourself X-Git-Tag: 5.2.0dr6~24^2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89e46c41f1e6e818979a9aab07447a807629f179;p=thirdparty%2Fstrongswan.git windows: Include for Vista instead of defining CondVar/SRWLock functions ourself --- diff --git a/src/libstrongswan/threading/windows/mutex.c b/src/libstrongswan/threading/windows/mutex.c index 873cb8f984..a268895800 100644 --- a/src/libstrongswan/threading/windows/mutex.c +++ b/src/libstrongswan/threading/windows/mutex.c @@ -13,13 +13,12 @@ * for more details. */ -#include +#include "thread.h" + #include #include #include -#include "thread.h" - typedef struct private_mutex_t private_mutex_t; typedef struct private_condvar_t private_condvar_t; diff --git a/src/libstrongswan/threading/windows/rwlock.c b/src/libstrongswan/threading/windows/rwlock.c index b27ef0035e..0de57f7135 100644 --- a/src/libstrongswan/threading/windows/rwlock.c +++ b/src/libstrongswan/threading/windows/rwlock.c @@ -13,14 +13,13 @@ * for more details. */ -#include +#include "thread.h" + #include #include #include #include -#include "thread.h" - typedef struct private_rwlock_t private_rwlock_t; typedef struct private_rwlock_condvar_t private_rwlock_condvar_t; diff --git a/src/libstrongswan/threading/windows/thread.c b/src/libstrongswan/threading/windows/thread.c index 35d56c47df..2ea0f9a7e3 100644 --- a/src/libstrongswan/threading/windows/thread.c +++ b/src/libstrongswan/threading/windows/thread.c @@ -13,15 +13,14 @@ * for more details. */ -#include +#include "thread.h" + #include #include #include #include #include -#include "thread.h" - typedef struct private_thread_t private_thread_t; diff --git a/src/libstrongswan/threading/windows/thread.h b/src/libstrongswan/threading/windows/thread.h index 5711717023..3c470522bb 100644 --- a/src/libstrongswan/threading/windows/thread.h +++ b/src/libstrongswan/threading/windows/thread.h @@ -16,6 +16,10 @@ #ifndef WINDOWS_THREAD_H_ #define WINDOWS_THREAD_H_ +/* for conditionVariables, Vista */ +#define _WIN32_WINNT 0x0600 +#include + /** * @defgroup windowsthread windows * @ingroup threading @@ -24,27 +28,6 @@ * @{ @ingroup windowsthread */ -/** - * MinGW seems to miss the actual struct definition - */ -typedef struct { - PVOID Ptr; -} SRWLOCK, *PSRWLOCK, CONDITION_VARIABLE, *PCONDITION_VARIABLE; - -VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable); -BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, - PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds); -BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, - PSRWLOCK SRWLock, DWORD dwMilliseconds, ULONG Flags); -VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable); -VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable); -VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK SRWLock); -VOID WINAPI AcquireSRWLockShared(PSRWLOCK SRWLock); -BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock); -VOID WINAPI InitializeSRWLock(PSRWLOCK SRWLock); -VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK SRWLock); -VOID WINAPI ReleaseSRWLockShared(PSRWLOCK SRWLock); - /** * Set active condvar of a thread before waiting in it. * diff --git a/src/libstrongswan/threading/windows/thread_value.c b/src/libstrongswan/threading/windows/thread_value.c index da79d7b44c..1dd8a78165 100644 --- a/src/libstrongswan/threading/windows/thread_value.c +++ b/src/libstrongswan/threading/windows/thread_value.c @@ -13,11 +13,10 @@ * for more details. */ -#include -#include - #include "thread.h" +#include + typedef struct private_thread_value_t private_thread_value_t;