[pango/memdup2: 1/2] Add compatibility shim for g_memdup2()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/memdup2: 1/2] Add compatibility shim for g_memdup2()
- Date: Fri, 19 Mar 2021 03:26:12 +0000 (UTC)
commit 69a7dde587b14038cb6009608ed03618f0b3cbfd
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Mar 18 23:20:12 2021 -0400
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.
pango/pango-impl-utils.h | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h
index 92a1168e..d2420321 100644
--- a/pango/pango-impl-utils.h
+++ b/pango/pango-impl-utils.h
@@ -201,6 +201,14 @@ pango_get_ignorable_size (gunichar ch,
return nick;
}
+/* 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
+
G_END_DECLS
#endif /* __PANGO_IMPL_UTILS_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]