Make rpc headers self-compilable

Fixes: #633
This commit is contained in:
Azat Khuzhin 2018-05-07 02:39:44 +03:00
parent 1619cc35e4
commit c57f5c3490
3 changed files with 16 additions and 1 deletions

View File

@ -27,6 +27,8 @@
#ifndef EVENT2_RPC_H_INCLUDED_
#define EVENT2_RPC_H_INCLUDED_
/* For int types. */
#include <event2/util.h>
#include <event2/visibility.h>
#ifdef __cplusplus

View File

@ -38,6 +38,16 @@ extern "C" {
*/
/* Fix so that people don't have to run with <sys/queue.h> */
#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

View File

@ -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"