From 2151e2ea53d124af100c573024d8e1626c8d4390 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Jan 2009 09:16:20 +0100 Subject: mapper: check if g_get_user_special_dir() is supported by GLib g_get_user_special_dir() was introduced with GLib 2.14. Don't use it in older versions. --- src/mapper.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mapper.c') diff --git a/src/mapper.c b/src/mapper.c index 2b3533a4d..642822c3f 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -51,10 +51,12 @@ void mapper_init(void) if (music_dir_param != NULL) { music_dir = g_strdup(music_dir_param->value); } else { +#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 14) music_dir = g_strdup(g_get_user_special_dir(G_USER_DIRECTORY_MUSIC)); if (music_dir == NULL) /* GLib failed to determine the XDG music directory - abort */ +#endif g_error("config parameter \"%s\" not found\n", CONF_MUSIC_DIR); } -- cgit v1.2.3