Code

require libmpdclient 2.9, remove several #ifdefs
authorMax Kellermann <max.kellermann@gmail.com>
Fri, 10 Mar 2017 20:20:55 +0000 (21:20 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Fri, 10 Mar 2017 20:20:55 +0000 (21:20 +0100)
INSTALL
NEWS
configure.ac
src/main.c
src/mpdclient.c
src/mpdclient.h

diff --git a/INSTALL b/INSTALL
index 85e790a400878be9bd980c5e26f317d2c55a9633..30ec307778842ea404aa7e5414a6e0fb2aa3fe18 100644 (file)
--- 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 be3090b695c3a25bf508225c78e0218c3e25b273..e758972b4710fb31555b0ff476290d9452b16829 100644 (file)
--- 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
 
index 77c47017e72190d05ea9ac5ca59f7fda1b2670b4..0f15fd3ea4b6c14db6a3b5fd8a108a202688e5eb 100644 (file)
@@ -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)
index 044221024ff11bf1f78947a4ebe7e402edb8670b..7e5a6cb3000c35605b62eb4728da2898bfe36889 100644 (file)
@@ -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
 }
 
 /**
index 1e01486a27c8c65bffcfaead13f95a08612a7eaa..e410fbe56b471c4ca2c33094bcc0fe5420b25a27 100644 (file)
@@ -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 ******************************************/
index 01294dbb48a1b8b3887a4e95a48f3506b46deaf0..f2204fb4a44230d6c8091ea3b973dc529a008beb 100644 (file)
@@ -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  **************************************************/