Fix #defines for Debian GNU/kFreeBSD

Because debian does not run with the freebsd libc, but rather uses the
GNU one, it chose to not define __FreeBSD__, but rather __FreeBSD_kernel__.
Use the alternative when the functionality tested is for kernel
features, and keep the __FreeBSD__ one when using freebsd libc
headers.

If this patch is applied, debian could drop all the current patches when
importing 6.0 :)
This commit is contained in:
Felipe Sateler 2014-11-29 16:54:57 -03:00 committed by David Henningsson
parent 5cae5fc848
commit 13a3daa928
6 changed files with 19 additions and 15 deletions

View file

@ -24,8 +24,10 @@
#ifdef HAVE_PTHREAD
#include <pthread.h>
#ifdef HAVE_PTHREAD_SETAFFINITY_NP
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifdef __FreeBSD__
#include <pthread_np.h>
#endif
#include <sys/param.h>
#include <sys/cpuset.h>
#endif
@ -63,7 +65,7 @@ static void thread_func(void *data) {
#ifdef HAVE_PTHREAD_SETAFFINITY_NP
static pa_atomic_t i_cpu = PA_ATOMIC_INIT(0);
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
cpuset_t mask;
#else
cpu_set_t mask;

View file

@ -31,8 +31,10 @@
#ifdef HAVE_PTHREAD
#include <pthread.h>
#ifdef HAVE_PTHREAD_SETAFFINITY_NP
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifdef __FreeBSD__
#include <pthread_np.h>
#endif
#include <sys/param.h>
#include <sys/cpuset.h>
#endif
@ -61,7 +63,7 @@ static void work(void *p) {
#ifdef HAVE_PTHREAD_SETAFFINITY_NP
{
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
cpuset_t mask;
#else
cpu_set_t mask;