mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
Make tests compile on FreeBSD
cpu_set_t is named cpuset_t on FreeBSD. Add headers to allow for warning free compilation.
This commit is contained in:
parent
d94cd5f730
commit
b115e9c592
2 changed files with 22 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue