fixes for libevent 1.4
This commit is contained in:
parent
0200b5144f
commit
0a78c37078
16
event-old.h
16
event-old.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user