Commit a8ddafb0 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '4332bf98'

* commit '4332bf98':
  w32threads: Don't use function pointers when linking directly to newer APIs
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 72196a4b 4332bf98
...@@ -62,11 +62,18 @@ typedef struct pthread_cond_t { ...@@ -62,11 +62,18 @@ typedef struct pthread_cond_t {
} pthread_cond_t; } pthread_cond_t;
/* function pointers to conditional variable API on windows 6.0+ kernels */ /* 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_broadcast)(pthread_cond_t *cond);
static void (WINAPI *cond_init)(pthread_cond_t *cond); static void (WINAPI *cond_init)(pthread_cond_t *cond);
static void (WINAPI *cond_signal)(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, static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
DWORD milliseconds); 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) static unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
{ {
...@@ -268,11 +275,6 @@ static void w32thread_init(void) ...@@ -268,11 +275,6 @@ static void w32thread_init(void)
(void*)GetProcAddress(kernel_dll, "WakeConditionVariable"); (void*)GetProcAddress(kernel_dll, "WakeConditionVariable");
cond_wait = cond_wait =
(void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS"); (void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS");
#else
cond_init = InitializeConditionVariable;
cond_broadcast = WakeAllConditionVariable;
cond_signal = WakeConditionVariable;
cond_wait = SleepConditionVariableCS;
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment