From 965e74f902645cf126011a5b929a8d9d254750cc Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 4 Feb 2021 19:27:22 +0000 Subject: [PATCH] Add compatibility shim for g_memdup2() We don't necessarily want to depend on a newer version of GLib, given that we're not really using g_memdup() in the wrong way. --- gdk/gdk-private.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h index 3df7d3215c..fb3c18cd6f 100644 --- a/gdk/gdk-private.h +++ b/gdk/gdk-private.h @@ -49,4 +49,12 @@ guint gdk_parse_debug_var (const char *variable, const GdkDebugKey *keys, guint nkeys); +/* Backward compatibility shim, to avoid bumping up the minimum + * required version of GLib; most of our uses of g_memdup() are + * safe, and those that aren't have been fixed + */ +#if !GLIB_CHECK_VERSION (2, 67, 3) +# define g_memdup2(mem,size) g_memdup((mem),(size)) +#endif + #endif /* __GDK__PRIVATE_H__ */