diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-02 11:27:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-02 11:27:57 -0400 |
commit | d3ceca800eb6478b9e0b74680e2bd247d8213187 (patch) | |
tree | aa7980a105c450c11c435717ef1ed7553251b74e /include/event2/event_struct.h | |
parent | acc4aca49e246a46e03f8978517c9b3d23b1baea (diff) | |
download | libevent-d3ceca800eb6478b9e0b74680e2bd247d8213187.tar.gz |
Declare evkeyvalq and event_list even if event_struct.h comes before sys/queue.h
Fixes bug 3036645 reported by Mihai Draghicioiu
Diffstat (limited to 'include/event2/event_struct.h')
-rw-r--r-- | include/event2/event_struct.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/include/event2/event_struct.h b/include/event2/event_struct.h index 80900ea3..9251a7a9 100644 --- a/include/event2/event_struct.h +++ b/include/event2/event_struct.h @@ -69,6 +69,15 @@ struct { \ } #endif /* !TAILQ_ENTRY */ +#ifndef TAILQ_HEAD +#define _EVENT_DEFINED_TQHEAD +#define TAILQ_HEAD(name, type) \ +struct name { \ + struct type *tqh_first; \ + struct type **tqh_last; \ +} +#endif + struct event_base; struct event { TAILQ_ENTRY(event) ev_active_next; @@ -121,15 +130,16 @@ struct evkeyval { char *value; }; -#ifdef _EVENT_DEFINED_TQENTRY -#undef TAILQ_ENTRY -struct event_list; -struct evkeyvalq; -#undef _EVENT_DEFINED_TQENTRY -#else TAILQ_HEAD (event_list, event); TAILQ_HEAD (evkeyvalq, evkeyval); -#endif /* _EVENT_DEFINED_TQENTRY */ + +#ifdef _EVENT_DEFINED_TQENTRY +#undef TAILQ_ENTRY +#endif + +#ifdef _EVENT_DEFINED_TQHEAD +#undef TAILQ_HEAD +#endif #ifdef __cplusplus } |