From: Nick Mathewson Date: Thu, 23 Apr 2009 18:04:50 +0000 (+0000) Subject: Fix win32 compilation issues. X-Git-Tag: release-2.0.3-alpha~278 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ad03264408238061cf894e7b4a0ffb4b8660315;p=libevent Fix win32 compilation issues. svn:r1234 --- diff --git a/evdns.c b/evdns.c index f4051d2e..a1d9431d 100644 --- a/evdns.c +++ b/evdns.c @@ -3392,7 +3392,7 @@ load_nameservers_with_getnetworkparams(struct evdns_base *base) IP_ADDR_STRING *ns; GetNetworkParams_fn_t fn; - ASSERT_LOCKD(base); + ASSERT_LOCKED(base); if (!(handle = LoadLibrary("iphlpapi.dll"))) { log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll"); status = -1; diff --git a/test/bench_httpclient.c b/test/bench_httpclient.c index 15079ed3..299d8ec2 100644 --- a/test/bench_httpclient.c +++ b/test/bench_httpclient.c @@ -26,8 +26,12 @@ */ #include +#ifdef WIN32 +#include +#else #include #include +#endif #include #include @@ -36,6 +40,9 @@ #include #include +/* for EVUTIL_ERR_CONNECT_RETRIABLE macro */ +#include "util-internal.h" + const char *resource = NULL; struct event_base *base = NULL; @@ -104,10 +111,10 @@ frob_socket(int sock) { struct linger l; int one = 1; - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one)); l.l_onoff = 1; l.l_linger = 0; - if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &l, sizeof(l))<0) + if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0) perror("setsockopt"); } @@ -131,7 +138,8 @@ launch_request(void) return -1; frob_socket(sock); if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) < 0) { - if (errno != EINTR && errno != EINPROGRESS) { + int e = errno; + if (! EVUTIL_ERR_CONNECT_RETRIABLE(e)) { return -1; } } diff --git a/test/regress_minheap.c b/test/regress_minheap.c index 57000afe..84aab4e1 100644 --- a/test/regress_minheap.c +++ b/test/regress_minheap.c @@ -34,8 +34,8 @@ static void set_random_timeout(struct event *ev) { - ev->ev_timeout.tv_sec = random(); - ev->ev_timeout.tv_usec = random(); + ev->ev_timeout.tv_sec = rand(); + ev->ev_timeout.tv_usec = rand(); ev->min_heap_idx = -1; } diff --git a/test/tinytest.c b/test/tinytest.c index b07d4d9b..07483b8c 100644 --- a/test/tinytest.c +++ b/test/tinytest.c @@ -102,7 +102,7 @@ _testcase_run_forked(const struct testgroup_t *group, */ int ok; char buffer[LONGEST_TEST_NAME+256]; - const char *verbosity; + //const char *verbosity; STARTUPINFO si; PROCESS_INFORMATION info; DWORD exitcode;