[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [tor/master] Build correctly with Libevent 2.0.4-alpha and later
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon, 15 Feb 2010 16:47:47 -0500
Subject: Build correctly with Libevent 2.0.4-alpha and later
Commit: 4e082ec84bb292db88537f656375c4403b14f20b
---
src/or/dns.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/or/dns.c b/src/or/dns.c
index c055c88..a9f6426 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -41,14 +41,22 @@ struct evdns_request;
evdns_resume()
#define evdns_base_config_windows_nameservers(base) \
evdns_config_windows_nameservers()
-#define evdns_base_set_option(base, opt, val, flags) \
- evdns_set_option((opt),(val),(flags))
+#define evdns_base_set_option_(base, opt, val) \
+ evdns_set_option((opt),(val),DNS_OPTIONS_ALL)
#define evdns_base_resolve_ipv4(base, addr, options, cb, ptr) \
((evdns_resolve_ipv4(addr, options, cb, ptr)<0) ? NULL : ((void*)1))
#define evdns_base_resolve_reverse(base, addr, options, cb, ptr) \
((evdns_resolve_reverse(addr, options, cb, ptr)<0) ? NULL : ((void*)1))
#define evdns_base_resolve_reverse_ipv6(base, addr, options, cb, ptr) \
((evdns_resolve_reverse_ipv6(addr, options, cb, ptr)<0) ? NULL : ((void*)1))
+
+#elif defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER < 0x02000303
+#define evdns_base_set_option_(base, opt, val) \
+ evdns_base_set_option((base), (opt),(val),DNS_OPTIONS_ALL)
+
+#else
+#define evdns_base_set_option_ evdns_base_set_option
+
#endif
/** Longest hostname we're willing to resolve. */
@@ -1239,8 +1247,7 @@ configure_nameservers(int force)
}
#endif
-#define SET(k,v) \
- evdns_base_set_option(the_evdns_base, (k), (v), DNS_OPTIONS_ALL)
+#define SET(k,v) evdns_base_set_option_(the_evdns_base, (k), (v))
if (evdns_base_count_nameservers(the_evdns_base) == 1) {
SET("max-timeouts:", "16");
--
1.6.5