playlist_list: move fallback g_uri_parse_scheme() to glib_compat.h
This commit is contained in:
parent
067d7212bf
commit
747e945d29
@ -59,4 +59,19 @@ g_uri_escape_string(const char *unescaped,
|
||||
|
||||
#endif /* !2.16 */
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,16,0)
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static inline char *
|
||||
g_uri_parse_scheme(const char *uri)
|
||||
{
|
||||
const char *end = strstr(uri, "://");
|
||||
if (end == NULL)
|
||||
return NULL;
|
||||
return g_strndup(uri, end - uri);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -32,8 +32,7 @@
|
||||
#include "uri.h"
|
||||
#include "utils.h"
|
||||
#include "conf.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include "glib_compat.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
@ -112,18 +111,6 @@ playlist_list_global_finish(void)
|
||||
playlist_plugin_finish(playlist_plugins[i]);
|
||||
}
|
||||
|
||||
/* g_uri_parse_scheme() was introduced in GLib 2.16 */
|
||||
#if !GLIB_CHECK_VERSION(2,16,0)
|
||||
static char *
|
||||
g_uri_parse_scheme(const char *uri)
|
||||
{
|
||||
const char *end = strstr(uri, "://");
|
||||
if (end == NULL)
|
||||
return NULL;
|
||||
return g_strndup(uri, end - uri);
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct playlist_provider *
|
||||
playlist_list_open_uri_scheme(const char *uri, bool *tried)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user