From: Azat Khuzhin Date: Sun, 6 May 2018 23:39:44 +0000 (+0300) Subject: Make rpc headers self-compilable X-Git-Tag: release-2.1.9-beta^2~112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2732c9063503220e137c37aca48f706da0c29ed;p=libevent Make rpc headers self-compilable Fixes: #633 (cherry picked from commit c57f5c34903b02c6e7378865f71a2b83a5befb96) --- diff --git a/include/event2/rpc.h b/include/event2/rpc.h index 830d0c62..e7ada0b6 100644 --- a/include/event2/rpc.h +++ b/include/event2/rpc.h @@ -27,6 +27,8 @@ #ifndef EVENT2_RPC_H_INCLUDED_ #define EVENT2_RPC_H_INCLUDED_ +/* For int types. */ +#include #include #ifdef __cplusplus diff --git a/include/event2/rpc_struct.h b/include/event2/rpc_struct.h index 8f691f49..f3cb460a 100644 --- a/include/event2/rpc_struct.h +++ b/include/event2/rpc_struct.h @@ -38,6 +38,16 @@ extern "C" { */ +/* Fix so that people don't have to run with */ +#ifndef TAILQ_ENTRY +#define EVENT_DEFINED_TQENTRY_ +#define TAILQ_ENTRY(type) \ +struct { \ + struct type *tqe_next; /* next element */ \ + struct type **tqe_prev; /* address of previous next element */ \ +} +#endif /* !TAILQ_ENTRY */ + /** * provides information about the completed RPC request. */ @@ -93,6 +103,10 @@ struct evrpc { struct evrpc_base *base; }; +#ifdef EVENT_DEFINED_TQENTRY_ +#undef TAILQ_ENTRY +#endif + #ifdef __cplusplus } #endif diff --git a/test/regress_rpc.c b/test/regress_rpc.c index 01a058cb..2cb2bcd9 100644 --- a/test/regress_rpc.c +++ b/test/regress_rpc.c @@ -61,7 +61,6 @@ #include "event2/http_compat.h" #include "event2/http_struct.h" #include "event2/rpc.h" -#include "event2/rpc.h" #include "event2/rpc_struct.h" #include "event2/tag.h" #include "log-internal.h"