[pulseaudio-commits] src/tests

Tanu Kaskinen tanuk at kemper.freedesktop.org
Tue Feb 25 04:32:46 PST 2014


 src/tests/once-test.c |   11 +++++++++++
 src/tests/rtstutter.c |   11 +++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit b115e9c592d31be4e123017e3ee08b7125a28558
Author: Koop Mast <kwm at rainbow-runner.nl>
Date:   Sun Feb 23 00:56:59 2014 +0100

    Make tests compile on FreeBSD
    
    cpu_set_t is named cpuset_t on FreeBSD.
    Add headers to allow for warning free compilation.

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 <pthread.h>
+#ifdef HAVE_PTHREAD_SETAFFINITY_NP
+#if defined(__FreeBSD__)
+#include <pthread_np.h>
+#include <sys/param.h>
+#include <sys/cpuset.h>
+#endif
+#endif
 #endif
 
 #include <check.h>
@@ -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 <pthread.h>
+#ifdef HAVE_PTHREAD_SETAFFINITY_NP
+#if defined(__FreeBSD__)
+#include <pthread_np.h>
+#include <sys/param.h>
+#include <sys/cpuset.h>
+#endif
+#endif
 #endif
 
 #include <pulse/util.h>
@@ -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);



More information about the pulseaudio-commits mailing list