Commit ad6429b9 authored by Henrik Gramner's avatar Henrik Gramner

Windows: Fix conflicting pthread symbol names

parent 98528b76
......@@ -42,11 +42,15 @@ typedef void *pthread_mutexattr_t;
typedef void *pthread_condattr_t;
typedef void *pthread_attr_t;
int pthread_create(pthread_t* thread, const pthread_attr_t* attr,
void*(*proc)(void*), void* param);
void pthread_join(pthread_t thread, void** res);
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void));
int dav1d_pthread_create(pthread_t* thread, const pthread_attr_t* attr,
void*(*proc)(void*), void* param);
void dav1d_pthread_join(pthread_t thread, void** res);
int dav1d_pthread_once(pthread_once_t *once_control,
void (*init_routine)(void));
#define pthread_create dav1d_pthread_create
#define pthread_join dav1d_pthread_join
#define pthread_once dav1d_pthread_once
static inline void pthread_mutex_init(pthread_mutex_t* mutex,
const pthread_mutexattr_t* attr)
......
......@@ -49,8 +49,8 @@ static unsigned __stdcall dav1d_thread_entrypoint(void* data) {
return 0;
}
int pthread_create(pthread_t* thread, const pthread_attr_t* attr,
void*(*proc)(void*), void* param)
int dav1d_pthread_create(pthread_t* thread, const pthread_attr_t* attr,
void*(*proc)(void*), void* param)
{
dav1d_win32_thread_t* th = *thread = malloc(sizeof(*th));
(void)attr;
......@@ -69,7 +69,7 @@ int pthread_create(pthread_t* thread, const pthread_attr_t* attr,
return 0;
}
void pthread_join(pthread_t thread, void** res) {
void dav1d_pthread_join(pthread_t thread, void** res) {
dav1d_win32_thread_t* th = thread;
WaitForSingleObject(th->h, INFINITE);
......@@ -78,7 +78,9 @@ void pthread_join(pthread_t thread, void** res) {
free(th);
}
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) {
int dav1d_pthread_once(pthread_once_t *once_control,
void (*init_routine)(void))
{
BOOL fPending = FALSE;
BOOL fStatus;
......
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