[gtk/ebassi/memdup2: 68/78] Add compatibility shim for g_memdup2()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/memdup2: 68/78] Add compatibility shim for g_memdup2()
- Date: Thu, 11 Feb 2021 12:57:56 +0000 (UTC)
commit 965e74f902645cf126011a5b929a8d9d254750cc
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Feb 4 19:27:22 2021 +0000
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__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]