]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Feature detect cpu_set_t (#221) M-staged-PR221
authorAmos Jeffries <yadij@users.noreply.github.com>
Mon, 11 Jun 2018 22:01:17 +0000 (22:01 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 12 Jun 2018 10:20:31 +0000 (10:20 +0000)
Some OS define this type but do not define __cpu_set_t_defined.
Use proper feature detection instead of relying on the macro.

compat/cpu.h
configure.ac

index 54272480f0496fd1be8a7cdaf137ef13c8cd49d1..d8dbe22cae8d55049864e4bbfee717c0e7a62aa2 100644 (file)
@@ -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;
index c75f0c26ce395791eb432ea567b0b3360a7ad40c..3da4f30de18acd4ff637cd52b548bbecdfcd9b19 100644 (file)
@@ -2989,6 +2989,13 @@ AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
 #include <sys/ipc.h>
 #include <sys/msg.h>])
 
+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 <sched.h>
+#endif
+])
+
 # check for compiler support of %zu printf macro
 AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
 AC_MSG_CHECKING([for compiler %zu support])