]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
windows: Include for Vista instead of defining CondVar/SRWLock functions ourself
authorMartin Willi <martin@revosec.ch>
Thu, 2 Jan 2014 17:14:51 +0000 (18:14 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:05 +0000 (15:53 +0200)
src/libstrongswan/threading/windows/mutex.c
src/libstrongswan/threading/windows/rwlock.c
src/libstrongswan/threading/windows/thread.c
src/libstrongswan/threading/windows/thread.h
src/libstrongswan/threading/windows/thread_value.c

index 873cb8f9849b496033759b337a0a962fdd0d3115..a2688958006dbead9a02195f1f440fddfa2e5495 100644 (file)
  * for more details.
  */
 
-#include <library.h>
+#include "thread.h"
+
 #include <utils/debug.h>
 #include <threading/mutex.h>
 #include <threading/condvar.h>
 
-#include "thread.h"
-
 typedef struct private_mutex_t private_mutex_t;
 typedef struct private_condvar_t private_condvar_t;
 
index b27ef0035e9b78c4e2a2db446a0946b106b29941..0de57f7135c3dbafc23a1650196ce742b584aeab 100644 (file)
  * for more details.
  */
 
-#include <library.h>
+#include "thread.h"
+
 #include <utils/debug.h>
 #include <threading/rwlock.h>
 #include <threading/rwlock_condvar.h>
 #include <threading/thread_value.h>
 
-#include "thread.h"
-
 typedef struct private_rwlock_t private_rwlock_t;
 typedef struct private_rwlock_condvar_t private_rwlock_condvar_t;
 
index 35d56c47dfc94a72b2f7ff2ab635077a0ad3759e..2ea0f9a7e31730775b1c0ff6afebed99230e99ab 100644 (file)
  * for more details.
  */
 
-#include <library.h>
+#include "thread.h"
+
 #include <utils/debug.h>
 #include <threading/spinlock.h>
 #include <threading/thread.h>
 #include <collections/hashtable.h>
 #include <collections/array.h>
 
-#include "thread.h"
-
 
 typedef struct private_thread_t private_thread_t;
 
index 5711717023fa232476e0f1f984767203bae1843e..3c470522bb897dcd01711804378397c5b7c586e9 100644 (file)
 #ifndef WINDOWS_THREAD_H_
 #define WINDOWS_THREAD_H_
 
+/* for conditionVariables, Vista */
+#define _WIN32_WINNT 0x0600
+#include <library.h>
+
 /**
  * @defgroup windowsthread windows
  * @ingroup threading
  * @{ @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.
  *
index da79d7b44ceb7100dad454ecf01906c9ec9ca040..1dd8a781655742a7ae61a5f87ae5ce91a1a29933 100644 (file)
  * for more details.
  */
 
-#include <library.h>
-#include <threading/thread_value.h>
-
 #include "thread.h"
 
+#include <threading/thread_value.h>
+
 
 typedef struct private_thread_value_t private_thread_value_t;