[Libevent-users] [PATCH] TAILQ_ENTRY missing in evhttp.h on linux

Nick Mathewson nickm at freehaven.net
Mon Nov 5 22:06:02 EST 2007


On Tue, Oct 30, 2007 at 10:30:26AM -0500, Paul Fisher wrote:
> In using the latest 1.3e on linux, evhttp.h fails to compile because
> of a missing definition of TAILQ_ENTRY in evhttp.h.  This is due to
> the fact that the workaround in event.h is #define'd and #undef'd
> within event.h and not available to evhttp.h when defining "struct
> evhttp_request".  This patch obviously fixes it:
> 
> --- libevent-1.3e/evhttp.h	2007-08-25 13:49:22.000000000 -0500
> +++ libevent-1.3e.002/evhttp.h	2007-10-29 22:32:07.000000000 -0500
> @@ -108,7 +108,14 @@
>   * reasonable accessors.
>   */
>  struct evhttp_request {
> +#if defined(TAILQ_ENTRY)
>  	TAILQ_ENTRY(evhttp_request) next;
> +#else
> +struct {								\
> +	struct type *tqe_next;	/* next element */			\
> +	struct type **tqe_prev;	/* address of previous next element */	\
> +}       next;
> +#endif


I think you mean "struct evhttp_request" instead of "struct type".

I've checked this in; it's not the most elegant fix (as noted in the
rest of the thread), but an inelegant fix beats no fix at all.
-- 
Nick Mathewson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: not available
Url : http://monkeymail.org/archives/libevent-users/attachments/20071105/91f9eeee/attachment.bin


More information about the Libevent-users mailing list