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.
This commit is contained in:
parent
6139174d81
commit
2151e2ea53
|
@ -51,10 +51,12 @@ void mapper_init(void)
|
||||||
if (music_dir_param != NULL) {
|
if (music_dir_param != NULL) {
|
||||||
music_dir = g_strdup(music_dir_param->value);
|
music_dir = g_strdup(music_dir_param->value);
|
||||||
} else {
|
} 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));
|
music_dir = g_strdup(g_get_user_special_dir(G_USER_DIRECTORY_MUSIC));
|
||||||
if (music_dir == NULL)
|
if (music_dir == NULL)
|
||||||
/* GLib failed to determine the XDG music
|
/* GLib failed to determine the XDG music
|
||||||
directory - abort */
|
directory - abort */
|
||||||
|
#endif
|
||||||
g_error("config parameter \"%s\" not found\n", CONF_MUSIC_DIR);
|
g_error("config parameter \"%s\" not found\n", CONF_MUSIC_DIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue