From: Roy Marples Date: Fri, 22 Jan 2016 13:47:05 +0000 (+0000) Subject: Move the queue.h test to just before our structures as a system library X-Git-Tag: v6.10.2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=134fd7679060d49073817eb00756e97354c404d9;p=thirdparty%2Fdhcpcd.git Move the queue.h test to just before our structures as a system library could have already pulled the system one in. --- diff --git a/eloop.c b/eloop.c index c24c833c..d260d0ec 100644 --- a/eloop.c +++ b/eloop.c @@ -79,25 +79,6 @@ #include "eloop.h" -/* Our structures require TAILQ macros, which really every libc should - * ship as they are useful beyond belief. - * Sadly some libc's don't have sys/queue.h and some that do don't have - * the TAILQ_FOREACH macro. For those that don't, the application using - * this implementation will need to ship a working queue.h somewhere. - * If we don't have sys/queue.h found in config.h, then - * allow QUEUE_H to override loading queue.h in the current directory. */ -#ifndef TAILQ_FOREACH -#ifdef HAVE_SYS_QUEUE_H -#include -#elif defined(QUEUE_H) -#define __QUEUE_HEADER(x) #x -#define _QUEUE_HEADER(x) __QUEUE_HEADER(x) -#include _QUEUE_HEADER(QUEUE_H) -#else -#include "queue.h" -#endif -#endif - #ifndef UNUSED #define UNUSED(a) (void)((a)) #endif @@ -135,6 +116,25 @@ #include #endif +/* Our structures require TAILQ macros, which really every libc should + * ship as they are useful beyond belief. + * Sadly some libc's don't have sys/queue.h and some that do don't have + * the TAILQ_FOREACH macro. For those that don't, the application using + * this implementation will need to ship a working queue.h somewhere. + * If we don't have sys/queue.h found in config.h, then + * allow QUEUE_H to override loading queue.h in the current directory. */ +#ifndef TAILQ_FOREACH +#ifdef HAVE_SYS_QUEUE_H +#include +#elif defined(QUEUE_H) +#define __QUEUE_HEADER(x) #x +#define _QUEUE_HEADER(x) __QUEUE_HEADER(x) +#include _QUEUE_HEADER(QUEUE_H) +#else +#include "queue.h" +#endif +#endif + struct eloop_event { TAILQ_ENTRY(eloop_event) next; int fd;