From a4a13a382525527afeecd18f97e948bd6d0de64c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Apr 2013 01:49:43 +0200 Subject: use g_thread_new() if GLib is recent enough Fixes deprecation warnings. --- src/PlayerThread.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/PlayerThread.cxx') diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx index 2d8e6caaf..ccf16bb39 100644 --- a/src/PlayerThread.cxx +++ b/src/PlayerThread.cxx @@ -1202,8 +1202,12 @@ player_create(struct player_control *pc) { assert(pc->thread == NULL); +#if GLIB_CHECK_VERSION(2,32,0) + pc->thread = g_thread_new("player", player_task, pc); +#else GError *e = NULL; pc->thread = g_thread_create(player_task, pc, true, &e); if (pc->thread == NULL) MPD_ERROR("Failed to spawn player task: %s", e->message); +#endif } -- cgit v1.2.3