aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Wiley <wiley@google.com>2015-07-22 17:03:44 -0700
committerChristopher Wiley <wiley@google.com>2015-07-24 09:22:46 -0700
commitcdbf48321e4736fab2953337ed3b4950f26d5ee4 (patch)
treea57c38273a55a541855bb84d4ebc111c54d89ff8
parenta99fbc04c8ef4c347366dc91e65cb372a551b83b (diff)
downloadlibevent-cdbf48321e4736fab2953337ed3b4950f26d5ee4.tar.gz
Define missing TAILQ functions if any TAILQ function is provided
On both Android and some build hosts, TAILQ_END is not defined. It doesn't seem to be a standard BSD function at all, yet libevent depends on this. Rather than only patch up missing TAILQ_ functions when TAILQ_FOREACH is missing, always patch them up if we have sys/queue.h at all. Bug: 22608897 Change-Id: I367572dbce5a6425648eed934cfec7a3060b09cb
-rw-r--r--event-internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/event-internal.h b/event-internal.h
index 4163a7d..2f86b46 100644
--- a/event-internal.h
+++ b/event-internal.h
@@ -310,7 +310,7 @@ struct event_config {
};
/* Internal use only: Functions that might be missing from <sys/queue.h> */
-#if defined(_EVENT_HAVE_SYS_QUEUE_H) && !defined(_EVENT_HAVE_TAILQFOREACH)
+#if defined(_EVENT_HAVE_SYS_QUEUE_H)
#ifndef TAILQ_FIRST
#define TAILQ_FIRST(head) ((head)->tqh_first)
#endif
@@ -336,7 +336,7 @@ struct event_config {
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
} while (0)
#endif
-#endif /* TAILQ_FOREACH */
+#endif /* HAVE_SYS_QUEUE_H */
#define N_ACTIVE_CALLBACKS(base) \
((base)->event_count_active + (base)->defer_queue.active_count)