]> granicus.if.org Git - libevent/commitdiff
Stop rolling our own offsetof twice.
authorNick Mathewson <nickm@torproject.org>
Tue, 10 Feb 2009 21:39:56 +0000 (21:39 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 10 Feb 2009 21:39:56 +0000 (21:39 +0000)
svn:r1113

evdns.c

diff --git a/evdns.c b/evdns.c
index 7f6f74b9f0cfe1df906c078fb24d91b2d716422e..7b76ee395fa33d76bb28a0d3769f86d2196ebf6f 100644 (file)
--- a/evdns.c
+++ b/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])