diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-02 10:58:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-02 10:58:02 -0400 |
commit | 56e48c1019abe21081fe344846106722acf46c8e (patch) | |
tree | f4276d8b4193408d205c5304bdb59ddf2c9ed2e7 | |
parent | 2e6a985003cbe10921eef9036c2a7ba5cee5d683 (diff) | |
download | libevent-56e48c1019abe21081fe344846106722acf46c8e.tar.gz |
Fix a few mingw64 incompatibilities introduced since 2.0
-rw-r--r-- | buffer.c | 4 | ||||
-rw-r--r-- | event.c | 4 | ||||
-rw-r--r-- | signal.c | 2 | ||||
-rw-r--r-- | test/test-dumpevents.c | 3 |
4 files changed, 6 insertions, 7 deletions
@@ -2990,10 +2990,10 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) #endif #ifdef _WIN32 if (!(flags & EVBUF_FS_DISABLE_MMAP)) { - long h = (long)_get_osfhandle(fd); + intptr_t h = _get_osfhandle(fd); HANDLE m; ev_uint64_t total_size = length+offset; - if (h == (long)INVALID_HANDLE_VALUE) + if ((HANDLE)h == INVALID_HANDLE_VALUE) goto err; m = CreateFileMapping((HANDLE)h, NULL, PAGE_READONLY, (total_size >> 32), total_size & 0xfffffffful, @@ -2747,8 +2747,8 @@ event_queue_remove_inserted(struct event_base *base, struct event *ev) { EVENT_BASE_ASSERT_LOCKED(base); if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_INSERTED))) { - event_errx(1, "%s: %p(fd %d) not on queue %x", __func__, - ev, ev->ev_fd, EVLIST_INSERTED); + event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__, + ev, EV_SOCK_ARG(ev->ev_fd), EVLIST_INSERTED); return; } DECR_EVENT_COUNT(base, ev->ev_flags); @@ -362,7 +362,7 @@ evsig_del(struct event_base *base, evutil_socket_t evsignal, short old, short ev { EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG); - event_debug(("%s: %d: restoring signal handler", __func__, evsignal)); + event_debug(("%s: "EV_SOCK_FMT": restoring signal handler", __func__, EV_SOCK_ARG(evsignal))); EVSIGBASE_LOCK(); --evsig_base_n_signals_added; diff --git a/test/test-dumpevents.c b/test/test-dumpevents.c index ff01b3f8..1c272d4c 100644 --- a/test/test-dumpevents.c +++ b/test/test-dumpevents.c @@ -81,11 +81,10 @@ main(int argc, char **argv) #ifdef _WIN32 WORD wVersionRequested; WSADATA wsaData; - int err; wVersionRequested = MAKEWORD(2, 2); - err = WSAStartup(wVersionRequested, &wsaData); + WSAStartup(wVersionRequested, &wsaData); #endif #ifdef _WIN32 |