From: Nick Mathewson Date: Tue, 3 Apr 2012 22:31:08 +0000 (-0400) Subject: Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* X-Git-Tag: release-2.1.1-alpha^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1a03b2ff1bdba30a46a2cb291204f7e6f8a4d52;p=libevent Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* 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. --- diff --git a/include/event2/event.h b/include/event2/event.h index 39937072..700e8ca1 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -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.