From: Vsevolod Stakhov Date: Fri, 11 Sep 2015 14:14:39 +0000 (+0100) Subject: Add workaround for libevent 1.4. X-Git-Tag: 1.0.0~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7a2f455751a4bac7c5d2f3afd6979de9b1b6ea8;p=thirdparty%2Frspamd.git Add workaround for libevent 1.4. --- diff --git a/src/libutil/util.c b/src/libutil/util.c index 943c37b081..b537643cac 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -1963,3 +1963,11 @@ rspamd_time_jitter (gdouble in, gdouble jitter) return in + jitter * res; } + +#if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER < 0x02000000UL +struct event_base * +event_get_base (struct event *ev) +{ + return ev->ev_base; +} +#endif diff --git a/src/libutil/util.h b/src/libutil/util.h index 0903c23e5f..536caed2c1 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -396,4 +396,9 @@ guint64 rspamd_hash_seed (void); */ gdouble rspamd_time_jitter (gdouble in, gdouble jitter); +/* Special case for ancient libevent */ +#if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER < 0x02000000UL +struct event_base * event_get_base (struct event *ev); +#endif + #endif