use GLIB_CHECK_VERSION()
Use GLIB_CHECK_VERSION() instead of manually checking GLIB_MAJOR_VERSION, ...
This commit is contained in:
parent
82b081a6db
commit
ae87abae59
|
@ -66,7 +66,7 @@ static void version(void)
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 12)
|
||||
#if GLIB_CHECK_VERSION(2,12,0)
|
||||
static const char *summary =
|
||||
"Music Player Daemon - a daemon for playing music.";
|
||||
#endif
|
||||
|
@ -108,7 +108,7 @@ void parseOptions(int argc, char **argv, Options *options)
|
|||
context = g_option_context_new("[path/to/mpd.conf]");
|
||||
g_option_context_add_main_entries(context, entries, NULL);
|
||||
|
||||
#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 12)
|
||||
#if GLIB_CHECK_VERSION(2,12,0)
|
||||
g_option_context_set_summary(context, summary);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ buffer_free_callback(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
|||
}
|
||||
|
||||
/* g_queue_clear() was introduced in GLib 2.14 */
|
||||
#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 14
|
||||
#if GLIB_CHECK_VERSION(2,14,0)
|
||||
#define g_queue_clear(q) do { g_queue_free(q); q = g_queue_new(); } while (0)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void mapper_init(void)
|
|||
path = config_get_path(CONF_MUSIC_DIR);
|
||||
if (path != NULL)
|
||||
mapper_set_music_dir(path);
|
||||
#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 14)
|
||||
#if GLIB_CHECK_VERSION(2,14,0)
|
||||
else {
|
||||
path = g_get_user_special_dir(G_USER_DIRECTORY_MUSIC);
|
||||
if (path != NULL)
|
||||
|
|
Loading…
Reference in New Issue