]> granicus.if.org Git - libevent/commitdiff
Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_*
authorNick Mathewson <nickm@torproject.org>
Tue, 3 Apr 2012 22:31:08 +0000 (18:31 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 Apr 2012 22:31:08 +0000 (18:31 -0400)
This is a partial backport of cb9da0bf and a backport of c9635349.

Because C doesn't like us to declare identifiers starting with an
underscore, Libevent 2.1 has renamed every such identifier.  The
only change that affects a public API is that the _EVENT_LOG_*
macros have been renamed to start with EVENT_LOG instead.  The old
names are still present, but deprecated.

I'm doing this backport because it represents the deprecation of a
Libevent 2.0 interface, and folks should have the opportunity to
write code that isn't deprecated and works with both 2.0 and 2.1.

include/event2/event.h

index 39937072d3158e025761cc2ea89632daef698761..700e8ca1261f8838d7c410f9cafed58e1946edb3 100644 (file)
@@ -563,12 +563,19 @@ void event_base_free(struct event_base *);
 /** @name Log severities
  */
 /**@{*/
-#define _EVENT_LOG_DEBUG 0
-#define _EVENT_LOG_MSG   1
-#define _EVENT_LOG_WARN  2
-#define _EVENT_LOG_ERR   3
+#define EVENT_LOG_DEBUG 0
+#define EVENT_LOG_MSG   1
+#define EVENT_LOG_WARN  2
+#define EVENT_LOG_ERR   3
 /**@}*/
 
+/* Obsolete names: these are deprecated, but older programs might use them.
+ * They violate the reserved-identifier namespace. */
+#define _EVENT_LOG_DEBUG EVENT_LOG_DEBUG
+#define _EVENT_LOG_MSG EVENT_LOG_MSG
+#define _EVENT_LOG_WARN EVENT_LOG_WARN
+#define _EVENT_LOG_ERR EVENT_LOG_ERR
+
 /**
   A callback function used to intercept Libevent's log messages.