This fixes compilation on FreeBSD, which requires an extra include file and defines a slightly different type.
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
-
+#ifdef __FreeBSD__
+# include <pthread_np.h>
+#endif
bool g_singleThreaded;
int mapThreadToCPUList(pthread_t tid, const std::set<int>& cpus)
{
#ifdef HAVE_PTHREAD_SETAFFINITY_NP
+# ifndef cpu_set_t
+# define cpu_set_t cpuset_t
+# endif
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
for (const auto cpuID : cpus) {