tests: Fix incompatible pointer type on Debian kfreebsd
authorLaurent Bigonville <bigon@bigon.be>
Thu, 27 Aug 2020 13:58:55 +0000 (15:58 +0200)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Wed, 25 Nov 2020 14:54:49 +0000 (14:54 +0000)
Debian kfreebsd uses the GNU libc that uses cpu_set_t instead of cpuset_t

Also do not include unnecessary headers on this platform

Fixes: #851
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/356>

src/tests/once-test.c
src/tests/rtstutter.c

index cb56187076ecc843fd52df6a1b67019395011d02..c4d4b4be6c9b135bf9f3d1a08db8276a65f6bb83 100644 (file)
 #ifdef HAVE_PTHREAD
 #include <pthread.h>
 #ifdef HAVE_PTHREAD_SETAFFINITY_NP
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #ifdef __FreeBSD__
 #include <pthread_np.h>
-#endif
 #include <sys/param.h>
 #include <sys/cpuset.h>
 #endif
@@ -63,7 +61,7 @@ static void thread_func(void *data) {
 
 #ifdef HAVE_PTHREAD_SETAFFINITY_NP
     static pa_atomic_t i_cpu = PA_ATOMIC_INIT(0);
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#ifdef __FreeBSD__
     cpuset_t mask;
 #else
     cpu_set_t mask;
index 56b5146ca07e3ada7abad4ddf0314e5cf47cdd5b..9d74855a36af2c7e3a97e40cb320fbd69d02cb2d 100644 (file)
 #ifdef HAVE_PTHREAD
 #include <pthread.h>
 #ifdef HAVE_PTHREAD_SETAFFINITY_NP
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #ifdef __FreeBSD__
 #include <pthread_np.h>
-#endif
 #include <sys/param.h>
 #include <sys/cpuset.h>
 #endif
@@ -61,7 +59,7 @@ static void work(void *p) {
 
 #ifdef HAVE_PTHREAD_SETAFFINITY_NP
 {
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#ifdef __FreeBSD__
     cpuset_t mask;
 #else
     cpu_set_t mask;