14 March 2016: Wouter
- Fix warnings in ifdef corner case, older or unknown libevent.
+ - Fix compile for ub_event code with older libev.
11 March 2016: Wouter
- Remove warning about unused parameter in event_pluggable.c.
# define NATIVE_BITS_CB(c) (c)
#endif
+#ifndef EVFLAG_AUTO
+#define EVFLAG_AUTO 0
+#endif
+
#define AS_EVENT_BASE(x) \
(((union {struct ub_event_base* a; struct event_base* b;})x).b)
#define AS_UB_EVENT_BASE(x) \
return event_get_version();
}
-#if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
+#if (defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && defined(EVBACKEND_SELECT)
static const char* ub_ev_backend2str(int b)
{
switch(b) {
*n = "libev";
if (!b)
b = (struct event_base*)ev_default_loop(EVFLAG_AUTO);
+# ifdef EVBACKEND_SELECT
*m = ub_ev_backend2str(ev_backend((struct ev_loop*)b));
+# else
+ *m = "not obtainable";
+# endif
# elif defined(HAVE_EVENT_BASE_GET_METHOD)
*n = "libevent";
if (!b)
# define NATIVE_BITS_CB(c) (c)
#endif
+#ifndef EVFLAG_AUTO
+#define EVFLAG_AUTO 0
+#endif
+
struct my_event_base {
struct ub_event_base super;
struct event_base* base;
return NULL;
}
-#if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
+#if (defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && defined(EVBACKEND_SELECT)
static const char* ub_ev_backend2str_pluggable(int b)
{
switch(b) {
*s = event_get_version();
# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
*n = "pluggable-libev";
+# ifdef EVBACKEND_SELECT
*m = ub_ev_backend2str_pluggable(ev_backend((struct ev_loop*)b));
+# else
+ *m = "not obtainable";
+# endif
# elif defined(HAVE_EVENT_BASE_GET_METHOD)
*n = "pluggable-libevent";
*m = event_base_get_method(b);