Use internal implementation for evutil_timercmp() everywhere, to avoid bugs when the platform timercmp() has never heard of <= or >=. Also, replace timercmp() usage in min_heap.c with call to evutil_timercmp().
svn:r744
o provide bufferevent_input and bufferevent_output without requiring knowledge of the structure
o introduce bufferevent_setcb and bufferevent_setfd to allow better manipulation of bufferevents
o convert evhttp_connection to use bufferevents.
+ o use libevent's internal timercmp on all platforms, to avoid bugs on old platforms where timercmp(a,b,<=) is buggy.
+
Changes in 1.4.0:
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
#define evutil_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#endif
-#ifdef _EVENT_HAVE_TIMERCMP
-#define evutil_timercmp(tvp, uvp, cmp) timercmp((tvp), (uvp), cmp)
-#else
#define evutil_timercmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
-#endif
#ifdef _EVENT_HAVE_TIMERISSET
#define evutil_timerisset(tvp) timerisset(tvp)
#define _MIN_HEAP_H_
#include "event2/event.h"
+#include "event2/util.h"
typedef struct min_heap
{
int min_heap_elem_greater(struct event *a, struct event *b)
{
- return timercmp(&a->ev_timeout, &b->ev_timeout, >);
+ return evutil_timercmp(&a->ev_timeout, &b->ev_timeout, >);
}
void min_heap_ctor(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }