devicemonitor: g_queue_clear_full introduced in glib 2.60

The GStreamer dependency is glib >=2.56.0. Therefore, define
g_queue_clear_full if glib < 2.60.

Issue added in commit 1912bcbc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1251>
This commit is contained in:
Ruben Gonzalez 2021-10-25 21:55:25 +02:00
parent 6d447acef5
commit 0fee1e5d46

View file

@ -357,6 +357,18 @@ gst_device_monitor_dispose (GObject * object)
G_OBJECT_CLASS (gst_device_monitor_parent_class)->dispose (object);
}
#if !GLIB_CHECK_VERSION(2, 60, 0)
#define g_queue_clear_full queue_clear_full
static void
queue_clear_full (GQueue * queue, GDestroyNotify free_func)
{
gpointer data;
while ((data = g_queue_pop_head (queue)) != NULL)
free_func (data);
}
#endif
/**
* gst_device_monitor_get_devices:
* @monitor: A #GstDeviceProvider