summaryrefslogtreecommitdiff
path: root/lib/libevent/event.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-05-31 20:56:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-05-31 20:56:43 +0000
commit686f7819ca5d476b6e7dd6c2b528bc847057cc62 (patch)
treeebcde8de52effd689b53b96395638fdee5d1dd08 /lib/libevent/event.h
parent8a22260c9992f959d3c3a20e63c22ebdfc011659 (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/libevent/event.h')
-rw-r--r--lib/libevent/event.h12
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)