From: Amos Jeffries Date: Mon, 11 Jun 2018 22:01:17 +0000 (+0000) Subject: Feature detect cpu_set_t (#221) X-Git-Tag: M-staged-PR221 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f367e6af47c4ba71b0b285b2bc10a69fcd6f1baf;p=thirdparty%2Fsquid.git Feature detect cpu_set_t (#221) Some OS define this type but do not define __cpu_set_t_defined. Use proper feature detection instead of relying on the macro. --- diff --git a/compat/cpu.h b/compat/cpu.h index 54272480f0..d8dbe22cae 100644 --- a/compat/cpu.h +++ b/compat/cpu.h @@ -18,7 +18,7 @@ #if !HAVE_CPU_AFFINITY /* failing replacements to minimize the number of if-HAVE_CPU_AFFINITYs */ -#if !defined(__cpu_set_t_defined) +#if !HAVE_CPU_SET_T typedef struct { int bits; } cpu_set_t; diff --git a/configure.ac b/configure.ac index c75f0c26ce..3da4f30de1 100644 --- a/configure.ac +++ b/configure.ac @@ -2989,6 +2989,13 @@ AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1, #include #include ]) +AC_CHECK_TYPE(cpu_set_t, + AC_DEFINE(HAVE_CPU_SET_T,1,[cpu_set_t is defined by the system headers]),,[ +#if HAVE_SCHED_H +#include +#endif +]) + # check for compiler support of %zu printf macro AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro]) AC_MSG_CHECKING([for compiler %zu support])