summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-11-02 10:58:02 -0400
committerNick Mathewson <nickm@torproject.org>2012-11-02 10:58:02 -0400
commit56e48c1019abe21081fe344846106722acf46c8e (patch)
treef4276d8b4193408d205c5304bdb59ddf2c9ed2e7
parent2e6a985003cbe10921eef9036c2a7ba5cee5d683 (diff)
downloadlibevent-56e48c1019abe21081fe344846106722acf46c8e.tar.gz
Fix a few mingw64 incompatibilities introduced since 2.0
-rw-r--r--buffer.c4
-rw-r--r--event.c4
-rw-r--r--signal.c2
-rw-r--r--test/test-dumpevents.c3
4 files changed, 6 insertions, 7 deletions
diff --git a/buffer.c b/buffer.c
index a78ba26c..0a8a7df3 100644
--- a/buffer.c
+++ b/buffer.c
@@ -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,
diff --git a/event.c b/event.c
index 62744f80..6e6e64dd 100644
--- a/event.c
+++ b/event.c
@@ -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);
diff --git a/signal.c b/signal.c
index d73e4d99..63b38566 100644
--- a/signal.c
+++ b/signal.c
@@ -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