Commit 221a99aa authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '4622f11f'

* commit '4622f11f':
  w32pthread: help compiler figure out undeeded code
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 503aec14 4622f11f
...@@ -130,7 +130,7 @@ typedef struct win32_cond_t { ...@@ -130,7 +130,7 @@ typedef struct win32_cond_t {
static void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr) static void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
{ {
win32_cond_t *win32_cond = NULL; win32_cond_t *win32_cond = NULL;
if (cond_init) { if (_WIN32_WINNT >= 0x0600 || cond_init) {
cond_init(cond); cond_init(cond);
return; return;
} }
...@@ -155,7 +155,7 @@ static void pthread_cond_destroy(pthread_cond_t *cond) ...@@ -155,7 +155,7 @@ static void pthread_cond_destroy(pthread_cond_t *cond)
{ {
win32_cond_t *win32_cond = cond->ptr; win32_cond_t *win32_cond = cond->ptr;
/* native condition variables do not destroy */ /* native condition variables do not destroy */
if (cond_init) if (_WIN32_WINNT >= 0x0600 || cond_init)
return; return;
/* non native condition variables */ /* non native condition variables */
...@@ -172,7 +172,7 @@ static void pthread_cond_broadcast(pthread_cond_t *cond) ...@@ -172,7 +172,7 @@ static void pthread_cond_broadcast(pthread_cond_t *cond)
win32_cond_t *win32_cond = cond->ptr; win32_cond_t *win32_cond = cond->ptr;
int have_waiter; int have_waiter;
if (cond_broadcast) { if (_WIN32_WINNT >= 0x0600 || cond_broadcast) {
cond_broadcast(cond); cond_broadcast(cond);
return; return;
} }
...@@ -202,7 +202,7 @@ static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) ...@@ -202,7 +202,7 @@ static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{ {
win32_cond_t *win32_cond = cond->ptr; win32_cond_t *win32_cond = cond->ptr;
int last_waiter; int last_waiter;
if (cond_wait) { if (_WIN32_WINNT >= 0x0600 || cond_wait) {
cond_wait(cond, mutex, INFINITE); cond_wait(cond, mutex, INFINITE);
return 0; return 0;
} }
...@@ -234,7 +234,7 @@ static void pthread_cond_signal(pthread_cond_t *cond) ...@@ -234,7 +234,7 @@ static void pthread_cond_signal(pthread_cond_t *cond)
{ {
win32_cond_t *win32_cond = cond->ptr; win32_cond_t *win32_cond = cond->ptr;
int have_waiter; int have_waiter;
if (cond_signal) { if (_WIN32_WINNT >= 0x0600 || cond_signal) {
cond_signal(cond); cond_signal(cond);
return; return;
} }
......
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