diff --git a/src/libstrongswan/threading/windows/mutex.c b/src/libstrongswan/threading/windows/mutex.c index 873cb8f98..a26889580 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 b27ef0035..0de57f713 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 35d56c47d..2ea0f9a7e 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 571171702..3c470522b 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 da79d7b44..1dd8a7816 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;