mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Stop rolling our own offsetof twice.
svn:r1113
This commit is contained in:
parent
f04b90e5b3
commit
1ed27048e4
9
evdns.c
9
evdns.c
@ -323,14 +323,11 @@ struct evdns_base {
|
||||
|
||||
static struct evdns_base *current_base = NULL;
|
||||
|
||||
/* helper macro */
|
||||
#define OFFSET_OF(st, member) ((off_t) (((char*)&((st*)0)->member)-(char*)0))
|
||||
|
||||
/* Given a pointer to an evdns_server_request, get the corresponding */
|
||||
/* server_request. */
|
||||
#define TO_SERVER_REQUEST(base_ptr) \
|
||||
((struct server_request*) \
|
||||
(((char*)(base_ptr) - OFFSET_OF(struct server_request, base))))
|
||||
#define TO_SERVER_REQUEST(base_ptr) \
|
||||
((struct server_request*) \
|
||||
(((char*)(base_ptr) - evutil_offsetof(struct server_request, base))))
|
||||
|
||||
#define REQ_HEAD(base, id) ((base)->req_heads[id % (base)->n_req_heads])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user