On Sat, Nov 28, 2009 at 01:02:01AM +0100, Max Kellermann wrote:
> On 2009/11/28 00:55, gibbo...@gmail.com wrote:
> > Ok, you're 100% right, I just didn't dig the song struct so I missed
> > the unsigned pos. It's far proper with it.
> 
> That's a nice patch now!  What is your real name, so I can enter it in
> the git commit?
Raphaël Droz

> > Nothing related but git doesn't currently compile for me :
> > src/main.c:98:70: error: binary operator binaire missing before lexical 
> > element « ( »
> > But autogen.sh and ./configure succeed. Isn't a missing library version 
> > check ?
> 
> Uh, my bad.  The LIBMPDCLIENT_CHECK_VERSION macro isn't present in
> libmpdclient 2.0 yet, and that's why the #if test fails.  Care to fix
> it?  (Make it two lines: one for the #ifdef, and the "inner" #if for
> the actual version check)
Obvious patch attached (I didn't knew #define processing continue through all
& conditionnals even if the first one failed, I'm gonna sleep less stupid)

Raph
diff --git a/src/main.c b/src/main.c
index b0f0fb8..1d1c08c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -95,9 +95,11 @@ static struct command {
        {"list",        1,   -1,  0,    cmd_list,        "<type> [<type> 
<query>]", "Show all tags of <type>"},
        {"crossfade",   0,   1,   0,    cmd_crossfade,   "[<seconds>]", "Set 
and display crossfade settings"},
        {"update",      0,   -1,  2,    cmd_update,      "[<path>]", "Scan 
music directory for updates"},
-#if defined(LIBMPDCLIENT_CHECK_VERSION) && LIBMPDCLIENT_CHECK_VERSION(2,1,0)
+#if defined(LIBMPDCLIENT_CHECK_VERSION)
+#if LIBMPDCLIENT_CHECK_VERSION(2,1,0)
        {"sticker",     1,   -1,  0,    cmd_sticker,     "<uri> 
<get|set|list|del> <args..>", "Sticker management"},
 #endif
+#endif
        {"stats",       0,   -1,  0,    cmd_stats,       "", "Display 
statistics about MPD"},
        {"version",     0,   0,   0,    cmd_version,     "", "Report version of 
MPD"},
        /* loadtab, lstab, and tab used for completion-scripting only */
diff --git a/src/sticker.c b/src/sticker.c
index 25b26fb..68ef30c 100644
--- a/src/sticker.c
+++ b/src/sticker.c
@@ -25,7 +25,8 @@
 #include <string.h>
 #include <stdio.h>
 
-#if defined(LIBMPDCLIENT_CHECK_VERSION) && LIBMPDCLIENT_CHECK_VERSION(2,1,0)
+#if defined(LIBMPDCLIENT_CHECK_VERSION)
+#if LIBMPDCLIENT_CHECK_VERSION(2,1,0)
 
 static void my_finishCommand(struct mpd_connection *conn) {
        if (!mpd_response_finish(conn))
@@ -130,3 +131,4 @@ cmd_sticker(int argc, char **argv, struct mpd_connection 
*conn)
 }
 
 #endif /* libmpdclient 2.1 */
+#endif /* libmpdclient > 2.0 */
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to