summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2014-11-29 16:54:57 -0300
committerDavid Henningsson <david.henningsson@canonical.com>2014-12-01 12:11:07 +0100
commit13a3daa9285a8c5b0c1058e7e89d2a4de1cd8ad1 (patch)
treeff43c38557ffae5ed3f04ba27adf8b5a465d401a /src/tests
parent5cae5fc8482c3e47aa04f8e0bff020d85aeed6da (diff)
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 :)
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/once-test.c6
-rw-r--r--src/tests/rtstutter.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/tests/once-test.c b/src/tests/once-test.c
index 8b0009a00..5744eca3b 100644
--- a/src/tests/once-test.c
+++ b/src/tests/once-test.c
@@ -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;
diff --git a/src/tests/rtstutter.c b/src/tests/rtstutter.c
index ed567c130..8096ada84 100644
--- a/src/tests/rtstutter.c
+++ b/src/tests/rtstutter.c
@@ -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;