r19607@catbus: nickm | 2008-05-05 13:49:44 -0400

Hack to make sure that there is always a working fast EVENT_FD()


svn:r777
This commit is contained in:
Nick Mathewson 2008-05-05 17:49:52 +00:00
parent 4e8a339ef7
commit 957e9fd829
2 changed files with 14 additions and 0 deletions

View File

@ -450,6 +450,14 @@ int _event_initialized(struct event *, int check_fd);
*/
evutil_socket_t event_get_fd(struct event *ev);
#ifndef EVENT_FD
/* We haven't included event_struct.h, so define these as function calls
* rather than as direct struct access. If we include event_struct.h later,
* these macros will be overridden. */
#define EVENT_FD(ev) ((int)event_get_fd(ev))
#define EVENT_SIGNAL(ev) ((int)event_get_fd(ev))
#endif
/**
Get the libevent version number.

View File

@ -119,8 +119,14 @@ struct event {
int ev_flags;
};
#ifdef EVENT_FD
/* This was defined in event.h, but since we're including event_struct.h, we
* can use the faster versions. */
#undef EVENT_FD
#undef EVENT_SIGNAL
#define EVENT_SIGNAL(ev) ((int)(ev)->ev_fd)
#define EVENT_FD(ev) ((int)(ev)->ev_fd)
#endif
/*
* Key-Value pairs. Can be used for HTTP headers but also for