mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Fix a few mingw64 incompatibilities introduced since 2.0
This commit is contained in:
parent
2e6a985003
commit
56e48c1019
4
buffer.c
4
buffer.c
@ -2990,10 +2990,10 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
|
if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
|
||||||
long h = (long)_get_osfhandle(fd);
|
intptr_t h = _get_osfhandle(fd);
|
||||||
HANDLE m;
|
HANDLE m;
|
||||||
ev_uint64_t total_size = length+offset;
|
ev_uint64_t total_size = length+offset;
|
||||||
if (h == (long)INVALID_HANDLE_VALUE)
|
if ((HANDLE)h == INVALID_HANDLE_VALUE)
|
||||||
goto err;
|
goto err;
|
||||||
m = CreateFileMapping((HANDLE)h, NULL, PAGE_READONLY,
|
m = CreateFileMapping((HANDLE)h, NULL, PAGE_READONLY,
|
||||||
(total_size >> 32), total_size & 0xfffffffful,
|
(total_size >> 32), total_size & 0xfffffffful,
|
||||||
|
4
event.c
4
event.c
@ -2747,8 +2747,8 @@ event_queue_remove_inserted(struct event_base *base, struct event *ev)
|
|||||||
{
|
{
|
||||||
EVENT_BASE_ASSERT_LOCKED(base);
|
EVENT_BASE_ASSERT_LOCKED(base);
|
||||||
if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_INSERTED))) {
|
if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_INSERTED))) {
|
||||||
event_errx(1, "%s: %p(fd %d) not on queue %x", __func__,
|
event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__,
|
||||||
ev, ev->ev_fd, EVLIST_INSERTED);
|
ev, EV_SOCK_ARG(ev->ev_fd), EVLIST_INSERTED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DECR_EVENT_COUNT(base, ev->ev_flags);
|
DECR_EVENT_COUNT(base, ev->ev_flags);
|
||||||
|
2
signal.c
2
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);
|
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();
|
EVSIGBASE_LOCK();
|
||||||
--evsig_base_n_signals_added;
|
--evsig_base_n_signals_added;
|
||||||
|
@ -81,11 +81,10 @@ main(int argc, char **argv)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
int err;
|
|
||||||
|
|
||||||
wVersionRequested = MAKEWORD(2, 2);
|
wVersionRequested = MAKEWORD(2, 2);
|
||||||
|
|
||||||
err = WSAStartup(wVersionRequested, &wsaData);
|
WSAStartup(wVersionRequested, &wsaData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user