From cbaa2763b6e986d26f1bf3b0766ea8d339ed43af Mon Sep 17 00:00:00 2001 From: Koop Mast Date: Sun, 23 Feb 2014 00:56:59 +0100 Subject: [PATCH] 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 | 11 +++++++++++ src/tests/rtstutter.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/tests/once-test.c b/src/tests/once-test.c index b39a0e3..8b0009a 100644 --- a/src/tests/once-test.c +++ b/src/tests/once-test.c @@ -23,6 +23,13 @@ #ifdef HAVE_PTHREAD #include +#ifdef HAVE_PTHREAD_SETAFFINITY_NP +#if defined(__FreeBSD__) +#include +#include +#include +#endif +#endif #endif #include @@ -56,7 +63,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..ed567c1 100644 --- a/src/tests/rtstutter.c +++ b/src/tests/rtstutter.c @@ -30,6 +30,13 @@ #ifdef HAVE_PTHREAD #include +#ifdef HAVE_PTHREAD_SETAFFINITY_NP +#if defined(__FreeBSD__) +#include +#include +#include +#endif +#endif #endif #include @@ -54,7 +61,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.4