summaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/thread.c b/src/thread.c
index 6efacec..e2c3b63 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -22,13 +22,16 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#ifdef WIN32
+#include <windows.h>
+#endif
#include "common.h"
#include "libimobiledevice-glue/thread.h"
LIBIMOBILEDEVICE_GLUE_API int thread_new(THREAD_T *thread, thread_func_t thread_func, void* data)
{
#ifdef WIN32
- HANDLE th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)thread_func, data, 0, NULL);
+ HANDLE th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)(void*)thread_func, data, 0, NULL);
if (th == NULL) {
return -1;
}
@@ -93,7 +96,7 @@ LIBIMOBILEDEVICE_GLUE_API int thread_cancel(THREAD_T thread)
LIBIMOBILEDEVICE_GLUE_API void mutex_init(mutex_t* mutex)
{
#ifdef WIN32
- InitializeCriticalSection(mutex);
+ InitializeCriticalSection((LPCRITICAL_SECTION)mutex);
#else
pthread_mutex_init(mutex, NULL);
#endif
@@ -102,7 +105,7 @@ LIBIMOBILEDEVICE_GLUE_API void mutex_init(mutex_t* mutex)
LIBIMOBILEDEVICE_GLUE_API void mutex_destroy(mutex_t* mutex)
{
#ifdef WIN32
- DeleteCriticalSection(mutex);
+ DeleteCriticalSection((LPCRITICAL_SECTION)mutex);
#else
pthread_mutex_destroy(mutex);
#endif
@@ -111,7 +114,7 @@ LIBIMOBILEDEVICE_GLUE_API void mutex_destroy(mutex_t* mutex)
LIBIMOBILEDEVICE_GLUE_API void mutex_lock(mutex_t* mutex)
{
#ifdef WIN32
- EnterCriticalSection(mutex);
+ EnterCriticalSection((LPCRITICAL_SECTION)mutex);
#else
pthread_mutex_lock(mutex);
#endif
@@ -120,7 +123,7 @@ LIBIMOBILEDEVICE_GLUE_API void mutex_lock(mutex_t* mutex)
LIBIMOBILEDEVICE_GLUE_API void mutex_unlock(mutex_t* mutex)
{
#ifdef WIN32
- LeaveCriticalSection(mutex);
+ LeaveCriticalSection((LPCRITICAL_SECTION)mutex);
#else
pthread_mutex_unlock(mutex);
#endif