]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Feature detect cpu_set_t (#221)
authorAmos Jeffries <yadij@users.noreply.github.com>
Mon, 11 Jun 2018 22:01:17 +0000 (22:01 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 21 Jun 2018 11:24:24 +0000 (23:24 +1200)
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 bec6c22b15255953f92de3b3ec5325f08d51bb1a..3aa9488ee02dd5c5a8d3104cb695eeb573cad29a 100644 (file)
@@ -3026,6 +3026,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])