move pthread_setaffinity_np check to the build system

Rather than trying to encode all of the rules in a header, lets just put
them in the build system where they belong. This fixes the build on
FreeBSD, which does have pthraed_setaffinity_np, but it's in a
pthread_np.h, not behind _GNU_SOURCE. FreeBSD also implements cpu_set
slightly differently, so additional changes would be required to get it
working right there anyway.

v2: - fix #define in autotools

Fixes: 9f1bbbdbbd
       ("util: try to fix the Android and MacOS build")
Cc: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
Dylan Baker
2018-09-13 11:06:09 -07:00
parent 60d0c0d062
commit 3acc18fcf7
3 changed files with 23 additions and 4 deletions

View File

@@ -36,10 +36,6 @@
#include <signal.h>
#endif
#if defined(HAVE_PTHREAD) && !defined(ANDROID) && !defined(__APPLE__)
#define HAVE_PTHREAD_SETAFFINITY
#endif
static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
{
thrd_t thread;