diff --git a/WIN32-Code/event2/event-config.h b/WIN32-Code/event2/event-config.h index 97f102ad..dbf70bd5 100644 --- a/WIN32-Code/event2/event-config.h +++ b/WIN32-Code/event2/event-config.h @@ -334,13 +334,7 @@ #define EVENT__TIME_WITH_SYS_TIME 1 /* Version number of package */ -<<<<<<< HEAD #define EVENT__VERSION "2.1.0-alpha-dev" -||||||| merged common ancestors -#define EVENT__VERSION "2.0.16-stable-dev" -======= -#define EVENT__VERSION "2.0.17-stable" ->>>>>>> origin/patches-2.0 /* Define to appropriate substitue if compiler doesnt have __func__ */ #define EVENT____func__ __FUNCTION__ diff --git a/event.c b/event.c index 14950238..0f10b569 100644 --- a/event.c +++ b/event.c @@ -2129,6 +2129,7 @@ evthread_notify_base_default(struct event_base *base) return (r < 0 && errno != EAGAIN) ? -1 : 0; } +#ifdef EVENT__HAVE_EVENTFD /* Helper callback: wake an event_base from another thread. This version * assumes that you have a working eventfd() implementation. */ static int @@ -2142,6 +2143,8 @@ evthread_notify_base_eventfd(struct event_base *base) return (r < 0) ? -1 : 0; } +#endif + /** Tell the thread currently running the event_loop for base (if any) that it * needs to stop waiting in its dispatch function (if it is) and process all @@ -2963,6 +2966,7 @@ event_set_mem_functions(void *(*malloc_fn)(size_t sz), } #endif +#ifdef EVENT__HAVE_EVENTFD static void evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg) { @@ -2978,6 +2982,7 @@ evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg) base->is_notify_pending = 0; EVBASE_RELEASE_LOCK(base, th_base_lock); } +#endif static void evthread_notify_drain_default(evutil_socket_t fd, short what, void *arg) @@ -3012,13 +3017,16 @@ evthread_make_base_notifiable(struct event_base *base) return 0; } +#ifdef EVENT__HAVE_EVENTFD base->th_notify_fd[0] = evutil_eventfd_(0, EVUTIL_EFD_CLOEXEC|EVUTIL_EFD_NONBLOCK); if (base->th_notify_fd[0] >= 0) { base->th_notify_fd[1] = -1; notify = evthread_notify_base_eventfd; cb = evthread_notify_drain_eventfd; - } else if (evutil_make_internal_pipe_(base->th_notify_fd) == 0) { + } else +#endif + if (evutil_make_internal_pipe_(base->th_notify_fd) == 0) { notify = evthread_notify_base_default; cb = evthread_notify_drain_default; } else { diff --git a/include/event2/util.h b/include/event2/util.h index 68754c7a..eb120b21 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -65,6 +65,10 @@ extern "C" { #ifdef _WIN32 #include +#ifdef EVENT__HAVE_GETADDRINFO +/* for EAI_* definitions. */ +#include +#endif #else #include #endif diff --git a/test/regress_buffer.c b/test/regress_buffer.c index 05f17906..dfb680b5 100644 --- a/test/regress_buffer.c +++ b/test/regress_buffer.c @@ -757,7 +757,7 @@ test_evbuffer_add_file(void *ptr) data = malloc(1024*512); tt_assert(data); for (i = 0; i < datalen; ++i) - data[i] = evutil_weakrand_(); + data[i] = (char)evutil_weakrand_(); } else { data = strdup("here is a relatively small string."); tt_assert(data);