ports/databases/mysql-proxy/files/patch-src_chassis-mainloop.c
Jan Beich 696584469b databases/mysql-proxy: unbreak with libevent >= 2.1
chassis-mainloop.c:102:54: error: use of undeclared identifier '_EVENT_VERSION'
        if (0 != chassis_check_version(event_get_version(), _EVENT_VERSION)) {
                                                            ^
chassis-mainloop.c:104:15: error: use of undeclared identifier '_EVENT_VERSION'
                                G_STRLOC, _EVENT_VERSION, event_get_version());
                                          ^
/usr/local/include/glib-2.0/glib/gmessages.h:161:32: note: expanded from macro 'g_critical'
                               __VA_ARGS__)
                               ^
chassis-mainloop.c:119:37: error: use of undeclared identifier '_EVENT_VERSION'
        chas->event_hdr_version = g_strdup(_EVENT_VERSION);
                                           ^

PR:		216527
2017-01-27 19:26:22 +00:00

40 lines
1.7 KiB
C

Switch away from deprecated libevent macros.
--- src/chassis-mainloop.c.orig 2013-12-23 22:57:16 UTC
+++ src/chassis-mainloop.c
@@ -99,9 +99,9 @@ int chassis_check_version(const char *li
chassis *chassis_new() {
chassis *chas;
- if (0 != chassis_check_version(event_get_version(), _EVENT_VERSION)) {
+ if (0 != chassis_check_version(event_get_version(), LIBEVENT_VERSION)) {
g_critical("%s: chassis is build against libevent %s, but now runs against %s",
- G_STRLOC, _EVENT_VERSION, event_get_version());
+ G_STRLOC, LIBEVENT_VERSION, event_get_version());
return NULL;
}
@@ -116,7 +116,7 @@ chassis *chassis_new() {
chas->threads = chassis_event_threads_new();
- chas->event_hdr_version = g_strdup(_EVENT_VERSION);
+ chas->event_hdr_version = g_strdup(LIBEVENT_VERSION);
chas->shutdown_hooks = chassis_shutdown_hooks_new();
@@ -225,10 +225,10 @@ static void event_log_use_glib(int libev
GLogLevelFlags glib_log_level = G_LOG_LEVEL_DEBUG;
- if (libevent_log_level == _EVENT_LOG_DEBUG) glib_log_level = G_LOG_LEVEL_DEBUG;
- else if (libevent_log_level == _EVENT_LOG_MSG) glib_log_level = G_LOG_LEVEL_MESSAGE;
- else if (libevent_log_level == _EVENT_LOG_WARN) glib_log_level = G_LOG_LEVEL_WARNING;
- else if (libevent_log_level == _EVENT_LOG_ERR) glib_log_level = G_LOG_LEVEL_CRITICAL;
+ if (libevent_log_level == EVENT_LOG_DEBUG) glib_log_level = G_LOG_LEVEL_DEBUG;
+ else if (libevent_log_level == EVENT_LOG_MSG) glib_log_level = G_LOG_LEVEL_MESSAGE;
+ else if (libevent_log_level == EVENT_LOG_WARN) glib_log_level = G_LOG_LEVEL_WARNING;
+ else if (libevent_log_level == EVENT_LOG_ERR) glib_log_level = G_LOG_LEVEL_CRITICAL;
g_log(G_LOG_DOMAIN, glib_log_level, "(libevent) %s", msg);
}