commit 87e40628fa517c12135d3edee522705522042f79 from: Omar Polo date: Fri May 14 18:01:14 2021 UTC properly check for sys/queue.h before we (wrongly) always used the bundled version commit - be2ee49f5c6c8d9873d87298c0a8f988c28867a2 commit + 87e40628fa517c12135d3edee522705522042f79 blob - af6665661ccb249ba389205c3b95412ca701745d blob + 001d64906518ec28ffeea8492451e065107c293c --- configure.ac +++ configure.ac @@ -22,6 +22,25 @@ AC_REPLACE_FUNCS([ setproctitle \ ]) +AC_MSG_CHECKING([for sys/queue.h with TAILQ_FOREACH_SAFE]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +#include +#include +], [ + TAILQ_HEAD(tailhead, entry) head; + struct entry { + TAILQ_ENTRY(entry) entries; + } *np, *nt; + TAILQ_INIT(&head); + TAILQ_FOREACH_SAFE(np, &head, entries, nt) { + /* nop */ ; + } + return 0; +])], [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_QUEUE_H], 1, [QUEUE_H]) +], AC_MSG_RESULT(no)) + AC_CHECK_DECL(PR_SET_NAME, AC_DEFINE([HAVE_PR_SET_NAME], 1, [pr_set_name]), [], [[#include ]])