mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
build: avoid pthreads-win32 on mingw
* src/util/threads.c (includes) [WIN32]: On mingw, favor native threading over pthreads-win32 library. * src/util/thread.h [WIN32] Likewise. Suggested by Daniel P. Berrange.
This commit is contained in:
parent
c37c321cc2
commit
6e5a04f034
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* threads-win32.c: basic thread synchronization primitives
|
* threads-win32.c: basic thread synchronization primitives
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Red Hat, Inc.
|
* Copyright (C) 2009-2010 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
|
|
||||||
#include "threads.h"
|
#include "threads.h"
|
||||||
|
|
||||||
#ifdef HAVE_PTHREAD_MUTEXATTR_INIT
|
/* On mingw, we prefer native threading over the sometimes-broken
|
||||||
|
* pthreads-win32 library wrapper. */
|
||||||
|
#ifdef WIN32
|
||||||
|
# include "threads-win32.c"
|
||||||
|
#elif defined HAVE_PTHREAD_MUTEXATTR_INIT
|
||||||
# include "threads-pthread.c"
|
# include "threads-pthread.c"
|
||||||
#else
|
#else
|
||||||
# ifdef WIN32
|
# error "Either pthreads or Win32 threads are required"
|
||||||
# include "threads-win32.c"
|
|
||||||
# else
|
|
||||||
# error "Either pthreads or Win32 threads are required"
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,14 +61,12 @@ int virThreadLocalInit(virThreadLocalPtr l,
|
|||||||
void *virThreadLocalGet(virThreadLocalPtr l);
|
void *virThreadLocalGet(virThreadLocalPtr l);
|
||||||
void virThreadLocalSet(virThreadLocalPtr l, void*);
|
void virThreadLocalSet(virThreadLocalPtr l, void*);
|
||||||
|
|
||||||
# ifdef HAVE_PTHREAD_MUTEXATTR_INIT
|
# ifdef WIN32
|
||||||
|
# include "threads-win32.h"
|
||||||
|
# elif defined HAVE_PTHREAD_MUTEXATTR_INIT
|
||||||
# include "threads-pthread.h"
|
# include "threads-pthread.h"
|
||||||
# else
|
# else
|
||||||
# ifdef WIN32
|
# error "Either pthreads or Win32 threads are required"
|
||||||
# include "threads-win32.h"
|
|
||||||
# else
|
|
||||||
# error "Either pthreads or Win32 threads are required"
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user