Fix a few mingw64 incompatibilities introduced since 2.0

This commit is contained in:
Nick Mathewson 2012-11-02 10:58:02 -04:00
parent 2e6a985003
commit 56e48c1019
4 changed files with 6 additions and 7 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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