diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-05-31 20:56:43 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-05-31 20:56:43 +0000 |
commit | 686f7819ca5d476b6e7dd6c2b528bc847057cc62 (patch) | |
tree | ebcde8de52effd689b53b96395638fdee5d1dd08 /lib | |
parent | 8a22260c9992f959d3c3a20e63c22ebdfc011659 (diff) |
Hide the timeout_* macros under an EVENT_DEPRECATED ifdef. These names
invite conflicts, they are rarely used, can trivially be replaced by
evtimer_*, and are deprecated and removed from event.h in later libevent
versions.
ok guenther deraadt
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libevent/event.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libevent/event.h b/lib/libevent/event.h index 54bdc1a008c..da92822aa28 100644 --- a/lib/libevent/event.h +++ b/lib/libevent/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.22 2010/04/21 21:02:47 nicm Exp $ */ +/* $OpenBSD: event.h,v 1.23 2010/05/31 20:56:42 nicm Exp $ */ /* * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu> @@ -453,6 +453,14 @@ int event_base_loopbreak(struct event_base *); #define evtimer_pending(ev, tv) event_pending(ev, EV_TIMEOUT, tv) #define evtimer_initialized(ev) ((ev)->ev_flags & EVLIST_INIT) +#ifdef EVENT_DEPRECATED +/* + * timeout_* are collision-prone names for macros, and they are + * deprecated. Define EVENT_DEPRECATED to expose them anyway. + * + * It is recommended evtimer_* be used instead. + */ + /** * Add a timeout event. * @@ -482,6 +490,8 @@ int event_base_loopbreak(struct event_base *); #define timeout_pending(ev, tv) event_pending(ev, EV_TIMEOUT, tv) #define timeout_initialized(ev) ((ev)->ev_flags & EVLIST_INIT) +#endif /* EVENT_DEPRECATED */ + #define signal_add(ev, tv) event_add(ev, tv) #define signal_set(ev, x, cb, arg) \ event_set(ev, x, EV_SIGNAL|EV_PERSIST, cb, arg) |