]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
TAILQ is now inlcuded via config.h either via sys/queue.h or compat/queue.h.
authorRoy Marples <roy@marples.name>
Mon, 10 Nov 2014 16:56:32 +0000 (16:56 +0000)
committerRoy Marples <roy@marples.name>
Mon, 10 Nov 2014 16:56:32 +0000 (16:56 +0000)
This allows dhcpcd to compile on systems that do not even supply sys/queue.h,
such as the musl C library.

Thanks to Juan RP.

12 files changed:
auth.c
auth.h
common.c
compat/queue.h
configure
dhcpcd.c
dhcpcd.h
eloop.c
if-options.c
ipv4.c
ipv6.h
ipv6nd.h

diff --git a/auth.c b/auth.c
index 818178481f46a1d57420a08c0edecb33a8a943d5..9c2bb9cc0ba9914582929bbb303e313a0a2332f7 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -26,7 +26,6 @@
  */
 
 #include <sys/file.h>
-#include <sys/queue.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <inttypes.h>
diff --git a/auth.h b/auth.h
index 848569f647e893dd25b1a9d5eb267a09a96865b8..cb4aa71d3c1c44b058c92b42bb3bec59cb3dbeb7 100644 (file)
--- a/auth.h
+++ b/auth.h
@@ -28,7 +28,7 @@
 #ifndef AUTH_H
 #define AUTH_H
 
-#include <sys/queue.h>
+#include "config.h"
 
 #define DHCPCD_AUTH_SEND       (1 << 0)
 #define DHCPCD_AUTH_REQUIRE    (1 << 1)
index b90027aa84aca8fdf998a21f2cc18272bd5df41f..705bcb0238b0534d7b1d1410d3acb1f7f01d5348 100644 (file)
--- a/common.c
+++ b/common.c
@@ -31,7 +31,9 @@
 #endif
 
 #ifndef __sun
+# if !defined(__linux__) || (defined(__linux__) && defined(__GLIBC__))
 #  include <sys/cdefs.h>
+# endif
 #endif
 
 #ifdef __APPLE__
index ef6a3b8260e33c5028bfc9ea5ad8ab523da300f7..99ac6b9460eaf78344c709b0a34e28f925351da1 100644 (file)
@@ -34,7 +34,6 @@
 #ifndef COMPAT_QUEUE_H
 #define COMPAT_QUEUE_H
 
-#include <sys/queue.h>
 /*
  * Tail queue definitions.
  */
index b64d072532a98bb2619e77cb7a8efba0035abf73..59d2eddce7a55cb48f6e3c7f8082a06ee56565f2 100755 (executable)
--- a/configure
+++ b/configure
@@ -687,6 +687,8 @@ EOF
 fi
 if [ "$TAILQ_FOREACH_SAFE" = no -o "$TAILQ_CONCAT" = no ]; then
        echo "#include          \"compat/queue.h\"">>$CONFIG_H
+else
+       echo "#include          <sys/queue.h>" >>$CONFIG_H
 fi
 
 if [ -z "$POSIX_SPAWN" ]; then
index 2587dd7cb3e455d851fbe291355639f39462c646..c4455b33c8a0b8264a649903c408bd6463f4bdb9 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -30,7 +30,6 @@ const char dhcpcd_copyright[] = "Copyright (c) 2006-2014 Roy Marples";
 #define _WITH_DPRINTF /* Stop FreeBSD bitching */
 
 #include <sys/file.h>
-#include <sys/queue.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/time.h>
index 45b0d021bb94982f887432f72a1648b3dd216d49..3ee1699b2c715575f3fb7b061671cf6493620793 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
 #ifndef DHCPCD_H
 #define DHCPCD_H
 
-#include <sys/queue.h>
 #include <sys/socket.h>
 #include <net/if.h>
 
+#include "config.h"
 #include "defs.h"
 #include "control.h"
 #include "if-options.h"
diff --git a/eloop.c b/eloop.c
index e5b14a5e6775861c5defa5319f5594bab461603c..61a8eb3556facacba084d8d1fa883b67fe7f517b 100644 (file)
--- a/eloop.c
+++ b/eloop.c
@@ -28,7 +28,6 @@
 /* Needed for ppoll(2) */
 #define _GNU_SOURCE
 
-#include <sys/queue.h>
 #include <sys/time.h>
 
 #include <errno.h>
@@ -38,6 +37,7 @@
 #include <stdlib.h>
 #include <syslog.h>
 
+#include "config.h"
 #include "common.h"
 #include "dhcpcd.h"
 #include "eloop.h"
index de7eeb299581c620c2bbaaef4f4164a23c935dc8..dc7162f03bf28d6ef4373bfeb29cd61b84e54073 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
-#include <sys/queue.h>
 
 #include <arpa/inet.h>
 
diff --git a/ipv4.c b/ipv4.c
index 7d2b99fc906475ff02606b937ae22f25c283229a..ddb1c973a44dd3aba02b3b1cc4fd60d525346627 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -25,7 +25,6 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/queue.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 
diff --git a/ipv6.h b/ipv6.h
index 0d1025b0312b8d6b1405bf6ccf704728ffb4ed2b..6864bce60d8680d2ce79a12030e92103e7bf55ac 100644 (file)
--- a/ipv6.h
+++ b/ipv6.h
@@ -28,7 +28,6 @@
 #ifndef IPV6_H
 #define IPV6_H
 
-#include <sys/queue.h>
 #include <sys/uio.h>
 
 #include <netinet/in.h>
@@ -38,6 +37,7 @@
 #  include <linux/ipv6.h>
 #endif
 
+#include "config.h"
 #include "dhcpcd.h"
 
 #define ALLROUTERS "ff02::2"
index 4d5180085310aff45884a275b473ed0b46c7e93c..7538f3609a075a0f0cd6f9abf98838b3457378ed 100644 (file)
--- a/ipv6nd.h
+++ b/ipv6nd.h
 #ifndef IPV6ND_H
 #define IPV6ND_H
 
-#include <sys/queue.h>
-
 #include <time.h>
 
+#include "config.h"
 #include "dhcpcd.h"
 #include "ipv6.h"