g_memdup is declared as deprecated in current GLib, safer replacement g_memdup2 is available since GLib-2.68.
Code is protected by GLIB_CHECK_VERSION macro, so should build on older distros as well.
See https://docs.gtk.org/glib/func.memdup2.html
if (cp_data_)
{
if (data_len) *data_len = cp_length_;
if (cp_data_)
{
if (data_len) *data_len = cp_length_;
+#if GLIB_CHECK_VERSION(2,68,0)
+ return (unsigned char *) g_memdup2(cp_data_, cp_length_);
+#else
return (unsigned char *) g_memdup(cp_data_, cp_length_);
return (unsigned char *) g_memdup(cp_data_, cp_length_);