From b5d0dba83e197dcc8ae884920b462268bf7ba029 Mon Sep 17 00:00:00 2001 From: Koop Mast Date: Fri, 21 Feb 2014 00:20:24 +0100 Subject: [PATCH 1/2] Make tests compile on FreeBSD cpu_set_t is named cpuset_t on FreeBSD. Add headers to allow for warning free compilation. --- src/tests/once-test.c | 9 +++++++++ src/tests/rtstutter.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/tests/once-test.c b/src/tests/once-test.c index b39a0e3..6c5ddd6 100644 --- a/src/tests/once-test.c +++ b/src/tests/once-test.c @@ -23,6 +23,11 @@ #ifdef HAVE_PTHREAD #include +#ifdef HAVE_PTHREAD_SETAFFINITY_NP +#include +#include +#include +#endif #endif #include @@ -56,7 +61,11 @@ static void thread_func(void *data) { #ifdef HAVE_PTHREAD_SETAFFINITY_NP static pa_atomic_t i_cpu = PA_ATOMIC_INIT(0); +#ifdef __FreeBSD__ + cpuset_t mask; +#else cpu_set_t mask; +#endif CPU_ZERO(&mask); CPU_SET((size_t) (pa_atomic_inc(&i_cpu) % n_cpu), &mask); diff --git a/src/tests/rtstutter.c b/src/tests/rtstutter.c index 739683d..2fc0200 100644 --- a/src/tests/rtstutter.c +++ b/src/tests/rtstutter.c @@ -30,6 +30,11 @@ #ifdef HAVE_PTHREAD #include +#ifdef HAVE_PTHREAD_SETAFFINITY_NP +#include +#include +#include +#endif #endif #include @@ -54,7 +59,11 @@ static void work(void *p) { #ifdef HAVE_PTHREAD_SETAFFINITY_NP { +#ifdef __FreeBSD__ + cpuset_t mask; +#else cpu_set_t mask; +#endif CPU_ZERO(&mask); CPU_SET((size_t) PA_PTR_TO_UINT(p), &mask); -- 1.8.5.2