fixes for libevent 1.4

This commit is contained in:
vvaltman 2014-09-21 13:25:46 +04:00
parent 0200b5144f
commit 0a78c37078

View File

@ -1,6 +1,14 @@
#ifndef __EVENT_OLD_H__
#define __EVENT_OLD_H__
#include <assert.h>
#define BEV_EVENT_READ EVBUFFER_READ
#define BEV_EVENT_WRITE EVBUFFER_WRITE
#define BEV_EVENT_EOF EVBUFFER_EOF
#define BEV_EVENT_ERROR EVBUFFER_ERROR
#define BEV_EVENT_TIMEOUT EVBUFFER_TIMEOUT
typedef int evutil_socket_t;
static inline struct event *event_new (struct event_base *base, int fd, int what, void(*callback)(int, short, void *), void *arg) __attribute__ ((unused));
@ -24,4 +32,12 @@ static void event_free (struct event *ev) {
event_del (ev);
free (ev);
}
static struct bufferevent *bufferevent_socket_new (struct event_base *base, int fd, int flags) __attribute__ ((unused));
static struct bufferevent *bufferevent_socket_new (struct event_base *base, int fd, int flags) {
assert (!flags);
struct bufferevent *bev = bufferevent_new(fd, 0, 0, 0, 0);
bufferevent_base_set (base, bev);
return bev;
}
#endif