From: Max Kellermann Date: Fri, 10 Mar 2017 20:20:55 +0000 (+0100) Subject: require libmpdclient 2.9, remove several #ifdefs X-Git-Tag: v0.26~81 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=323d2239df7d8b6a3b8005f14c7e90b5271a77e9;p=ncmpc.git require libmpdclient 2.9, remove several #ifdefs --- diff --git a/INSTALL b/INSTALL index 85e790a..30ec307 100644 --- a/INSTALL +++ b/INSTALL @@ -5,7 +5,7 @@ Requirements ------------ * a C99 compliant compiler (e.g. gcc) - * libmpdclient 2.3 + * libmpdclient 2.9 * ncurses (ncursesw for unicode / wide character support) * GLib 2.14 diff --git a/NEWS b/NEWS index be3090b..e758972 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ncmpc 0.26 - not yet released +* require libmpdclient 2.9 * adapt to lirc 0.9.4 * lyricswiki: update regex diff --git a/configure.ac b/configure.ac index 77c4701..0f15fd3 100644 --- a/configure.ac +++ b/configure.ac @@ -102,8 +102,8 @@ dnl Check for GLib PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.14],, [AC_MSG_ERROR([glib 2.14 is required])]) -dnl Check for libmpdclient 2.3 -PKG_CHECK_MODULES([LIBMPDCLIENT], [libmpdclient >= 2.3],, +dnl Check for libmpdclient 2.9 +PKG_CHECK_MODULES([LIBMPDCLIENT], [libmpdclient >= 2.9],, [AC_MSG_ERROR([libmpdclient2 is required])]) dnl Check for libmpdclient 2.5 (the chat screen requires this version) diff --git a/src/main.c b/src/main.c index 0442210..7e5a6cb 100644 --- a/src/main.c +++ b/src/main.c @@ -234,8 +234,6 @@ do_mpd_update(void) check_reconnect(); } -#if LIBMPDCLIENT_CHECK_VERSION(2,4,0) - static char * settings_name(const struct mpd_settings *settings) { @@ -253,12 +251,9 @@ settings_name(const struct mpd_settings *settings) return g_strdup_printf("%s:%u", host, port); } -#endif - static char * default_settings_name(void) { -#if LIBMPDCLIENT_CHECK_VERSION(2,4,0) struct mpd_settings *settings = mpd_settings_new(options.host, options.port, 0, NULL, options.password); @@ -269,14 +264,6 @@ default_settings_name(void) mpd_settings_free(settings); return name; -#else - /* - * localhost is actually not correct, we only know that - * mpd_connection_new() has connected to the "default host". - */ - const char *name = options.host ?: "localhost"; - return g_strdup(name); -#endif } /** diff --git a/src/mpdclient.c b/src/mpdclient.c index 1e01486..e410fbe 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -599,7 +599,6 @@ mpdclient_cmd_move(struct mpdclient *c, unsigned dest_pos, unsigned src_pos) return true; } -#if LIBMPDCLIENT_CHECK_VERSION(2,5,0) /* The client-to-client protocol (MPD 0.17.0) */ bool @@ -668,7 +667,6 @@ mpdclient_recv_message(struct mpdclient *c) return message; } -#endif /****************************************************************************/ /*** Playlist management functions ******************************************/ diff --git a/src/mpdclient.h b/src/mpdclient.h index 01294db..f2204fb 100644 --- a/src/mpdclient.h +++ b/src/mpdclient.h @@ -61,11 +61,9 @@ enum { | MPD_IDLE_OUTPUT | MPD_IDLE_OPTIONS | MPD_IDLE_UPDATE -#if LIBMPDCLIENT_CHECK_VERSION(2,5,0) | MPD_IDLE_STICKER | MPD_IDLE_SUBSCRIPTION | MPD_IDLE_MESSAGE -#endif }; /** functions ***************************************************************/ @@ -165,7 +163,6 @@ mpdclient_cmd_delete_range(struct mpdclient *c, unsigned start, unsigned end); bool mpdclient_cmd_move(struct mpdclient *c, unsigned dest, unsigned src); -#if LIBMPDCLIENT_CHECK_VERSION(2,5,0) bool mpdclient_cmd_subscribe(struct mpdclient *c, const char *channel); @@ -181,7 +178,6 @@ mpdclient_send_read_messages(struct mpdclient *c); struct mpd_message * mpdclient_recv_message(struct mpdclient *c); -#endif /*** playlist functions **************************************************/