aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-28 12:40:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-28 12:41:16 +0200
commita8ddafb0f418084ff0471a81cd60adf0de51a63d (patch)
tree8a363bc1e43dd92e20982e1112415ec4cf3bc68f
parent72196a4b8d4bf3fcd273d30334b993dc8b909b22 (diff)
parent4332bf98dc051fd1ffbd9d4ddc1c5e55790c96f1 (diff)
downloadffmpeg-a8ddafb0f418084ff0471a81cd60adf0de51a63d.tar.gz
Merge commit '4332bf98dc051fd1ffbd9d4ddc1c5e55790c96f1'
* commit '4332bf98dc051fd1ffbd9d4ddc1c5e55790c96f1': w32threads: Don't use function pointers when linking directly to newer APIs Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--compat/w32pthreads.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 4b6924f4af..afe5b33594 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -62,11 +62,18 @@ typedef struct pthread_cond_t {
} pthread_cond_t;
/* function pointers to conditional variable API on windows 6.0+ kernels */
+#if _WIN32_WINNT < 0x0600
static void (WINAPI *cond_broadcast)(pthread_cond_t *cond);
static void (WINAPI *cond_init)(pthread_cond_t *cond);
static void (WINAPI *cond_signal)(pthread_cond_t *cond);
static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
DWORD milliseconds);
+#else
+#define cond_init InitializeConditionVariable
+#define cond_broadcast WakeAllConditionVariable
+#define cond_signal WakeConditionVariable
+#define cond_wait SleepConditionVariableCS
+#endif
static unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
{
@@ -268,11 +275,6 @@ static void w32thread_init(void)
(void*)GetProcAddress(kernel_dll, "WakeConditionVariable");
cond_wait =
(void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS");
-#else
- cond_init = InitializeConditionVariable;
- cond_broadcast = WakeAllConditionVariable;
- cond_signal = WakeConditionVariable;
- cond_wait = SleepConditionVariableCS;
#endif
}