diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 01:53:22 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 01:53:22 +0000 |
commit | 4b9ca274e3f2523f6ff83e18b58dfe270ddca527 (patch) | |
tree | 27089475aa0daa70f0e3c31c1b72988ca1280299 /third_party | |
parent | 5b48157bdbac9df3e4c095e2739febe7acd96a42 (diff) | |
download | chromium_src-4b9ca274e3f2523f6ff83e18b58dfe270ddca527.zip chromium_src-4b9ca274e3f2523f6ff83e18b58dfe270ddca527.tar.gz chromium_src-4b9ca274e3f2523f6ff83e18b58dfe270ddca527.tar.bz2 |
Linux (libevent): Supply sys/queue.h replacement macros when needed.
Not all build platforms have a sufficiently up-to-date sys/queue.h
header. For those platforms which don't, we select libevent's replace
macros and augment them where we are still missing some.
Review URL: http://codereview.chromium.org/48048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/libevent/README.chromium | 2 | ||||
-rw-r--r-- | third_party/libevent/event-internal.h | 5 | ||||
-rw-r--r-- | third_party/libevent/evrpc.c | 1 | ||||
-rw-r--r-- | third_party/libevent/http.c | 1 | ||||
-rw-r--r-- | third_party/libevent/sys-queue-macros.patch | 47 |
5 files changed, 55 insertions, 1 deletions
diff --git a/third_party/libevent/README.chromium b/third_party/libevent/README.chromium index ddb34a4..1cbdd80 100644 --- a/third_party/libevent/README.chromium +++ b/third_party/libevent/README.chromium @@ -10,6 +10,8 @@ Changes from upstream: being installed (alternative is adding crazy -I arguments to the commandline) 4) The directories WIN32-Code and WIN32-Prj are not included 5) add mac/config.h from a run of configure on a Mac. +6) sys-queue-macros.patch is applied to build on systems which are missing a +complete sys/queue.h SConscript does not include a few files that don't build on Linux: devpoll.c, evport.c, kqueue.c diff --git a/third_party/libevent/event-internal.h b/third_party/libevent/event-internal.h index 7485f21..93ac568 100644 --- a/third_party/libevent/event-internal.h +++ b/third_party/libevent/event-internal.h @@ -71,7 +71,7 @@ struct event_base { }; /* Internal use only: Functions that might be missing from <sys/queue.h> */ -#ifndef HAVE_TAILQFOREACH +#if !defined(HAVE_TAILQFOREACH) || defined(__QUENTIN_BUILD__) #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_END(head) NULL #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) @@ -85,6 +85,9 @@ struct event_base { *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ } while (0) +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #endif /* TAILQ_FOREACH */ int _evsignal_set_handler(struct event_base *base, int evsignal, diff --git a/third_party/libevent/evrpc.c b/third_party/libevent/evrpc.c index 070fd9e7..194cdab 100644 --- a/third_party/libevent/evrpc.c +++ b/third_party/libevent/evrpc.c @@ -55,6 +55,7 @@ #include "event.h" #include "evrpc.h" +#include "event-internal.h" #include "evrpc-internal.h" #include "evhttp.h" #include "evutil.h" diff --git a/third_party/libevent/http.c b/third_party/libevent/http.c index 38a89b6..8fce37a 100644 --- a/third_party/libevent/http.c +++ b/third_party/libevent/http.c @@ -88,6 +88,7 @@ #include "evutil.h" #include "log.h" #include "http-internal.h" +#include "event-internal.h" #ifdef WIN32 #define strcasecmp _stricmp diff --git a/third_party/libevent/sys-queue-macros.patch b/third_party/libevent/sys-queue-macros.patch new file mode 100644 index 0000000..921545a --- /dev/null +++ b/third_party/libevent/sys-queue-macros.patch @@ -0,0 +1,47 @@ +diff --git a/third_party/libevent/event-internal.h b/third_party/libevent/event-internal.h +index 7485f21..93ac568 100644 +--- a/event-internal.h ++++ b/event-internal.h +@@ -71,7 +71,7 @@ struct event_base { + }; + + /* Internal use only: Functions that might be missing from <sys/queue.h> */ +-#ifndef HAVE_TAILQFOREACH ++#if !defined(HAVE_TAILQFOREACH) || defined(__QUENTIN_BUILD__) + #define TAILQ_FIRST(head) ((head)->tqh_first) + #define TAILQ_END(head) NULL + #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) +@@ -85,6 +85,9 @@ struct event_base { + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ + } while (0) ++#define TAILQ_LAST(head, headname) \ ++ (*(((struct headname *)((head)->tqh_last))->tqh_last)) ++#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) + #endif /* TAILQ_FOREACH */ + + int _evsignal_set_handler(struct event_base *base, int evsignal, +diff --git a/third_party/libevent/evrpc.c b/third_party/libevent/evrpc.c +index 070fd9e..194cdab 100644 +--- a/evrpc.c ++++ b/evrpc.c +@@ -55,6 +55,7 @@ + + #include "event.h" + #include "evrpc.h" ++#include "event-internal.h" + #include "evrpc-internal.h" + #include "evhttp.h" + #include "evutil.h" +diff --git a/third_party/libevent/http.c b/third_party/libevent/http.c +index 38a89b6..8fce37a 100644 +--- a/http.c ++++ b/http.c +@@ -88,6 +88,7 @@ + #include "evutil.h" + #include "log.h" + #include "http-internal.h" ++#include "event-internal.h" + + #ifdef WIN32 + #define strcasecmp _stricmp |