commit 19467d598676c21cf908e3ee8f60a6e04306cede from: Thomas Adam date: Sat Jul 16 12:06:42 2022 UTC portable: honour sys/queue.h directly Don't assert compat/queue.h in favour of what's on the system. When -portable was first being developed, there were frequent clashes between libbsd, and the check for sys/queue.h got lost in that noise. Noticed by stsp@ commit - d1ea27e3ceaf325bbedb07628a3921e8e101f5f4 commit + 19467d598676c21cf908e3ee8f60a6e04306cede blob - 45fdaf9ab0ae1e114a29a44dd2389d38cae2abb9 blob + d72bd29e18b0b34952a255c534f20a85ce4811fc --- configure.ac +++ configure.ac @@ -55,6 +55,7 @@ AC_CHECK_HEADERS([ \ sys/ioctl.h \ sys/param.h \ sys/poll.h \ + sys/queue.h \ sys/socket.h \ sys/time.h \ sys/tree.h \ @@ -339,39 +340,34 @@ AC_CHECK_DECL( SIMPLEQ_INIT, found_queue_h=yes, found_queue_h=no, - [#include ] ) AC_CHECK_DECL( TAILQ_CONCAT, found_queue_h=yes, found_queue_h=no, - [#include ] ) AC_CHECK_DECL( TAILQ_PREV, - found_queue_h=yes, + , found_queue_h=no, - [#include ] ) AC_CHECK_DECL( TAILQ_REPLACE, - found_queue_h=yes, + , found_queue_h=no, - [#include ] ) AC_CHECK_DECL( SIMPLEQ_ENTRY, , found_queue_h=no, - [#include ] ) AC_CHECK_DECL( TAILQ_FOREACH_SAFE, , found_queue_h=no, - [#include ] ) -if test "x$found_queue_h" = xyes; then + +if test "x$found_queue_h" = xyes -o "x$ac_cv_header_sys_queue_h" = xyes; then AC_DEFINE(HAVE_QUEUE_H) fi blob - de3e23a73dd41a772812c83e1071f04ecad9ee99 blob + 9070e63fcfd7256bf49ac0236f5dde1f3be5000b --- include/got_compat.h +++ include/got_compat.h @@ -114,10 +114,13 @@ void uuid_to_string(uuid_t *, char **, uint32_t *); #include #endif -#ifdef HAVE_QUEUE_H -#include -#else +/* Only include sys/queue.h if it's not found on the system (libbsd provides + * a copy of this). + */ +#if !defined(HAVE_QUEUE_H) && !defined(HAVE_LIBBSD) #include "compat/queue.h" +#else +#include #endif #ifdef HAVE_TREE_H