|
|
43435a |
From 32ee94c8a0079ee83a1b7d3910b1bbc6ccd8c747 Mon Sep 17 00:00:00 2001
|
|
|
43435a |
From: Benjamin Berg <bberg@redhat.com>
|
|
|
43435a |
Date: Mon, 14 Dec 2020 11:30:45 +0100
|
|
|
43435a |
Subject: [PATCH] Add compatibility defines to allow compiling with older glib
|
|
|
43435a |
|
|
|
43435a |
We need at least the GFlagsClass autoptr, but just pull in most of the
|
|
|
43435a |
definitions from libfprint.
|
|
|
43435a |
---
|
|
|
43435a |
src/fprintd.h | 15 +++++++++++++++
|
|
|
43435a |
1 file changed, 15 insertions(+)
|
|
|
43435a |
|
|
|
43435a |
diff --git a/src/fprintd.h b/src/fprintd.h
|
|
|
43435a |
index 4075bc2..63a742e 100644
|
|
|
43435a |
--- a/src/fprintd.h
|
|
|
43435a |
+++ b/src/fprintd.h
|
|
|
43435a |
@@ -91,3 +91,18 @@ FprintDevice *fprint_device_new (FpDevice *dev);
|
|
|
43435a |
guint32 _fprint_device_get_id (FprintDevice *rdev);
|
|
|
43435a |
/* Print */
|
|
|
43435a |
/* TODO */
|
|
|
43435a |
+
|
|
|
43435a |
+
|
|
|
43435a |
+/* Some compatibility definitions for older GLib. Copied from from libfprint. */
|
|
|
43435a |
+#if !GLIB_CHECK_VERSION (2, 57, 0)
|
|
|
43435a |
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GTypeClass, g_type_class_unref);
|
|
|
43435a |
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GEnumClass, g_type_class_unref);
|
|
|
43435a |
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GFlagsClass, g_type_class_unref);
|
|
|
43435a |
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GParamSpec, g_param_spec_unref);
|
|
|
43435a |
+#else
|
|
|
43435a |
+/* Re-define G_SOURCE_FUNC as we are technically not allowed to use it with
|
|
|
43435a |
+ * the version we depend on currently. */
|
|
|
43435a |
+#undef G_SOURCE_FUNC
|
|
|
43435a |
+#endif
|
|
|
43435a |
+
|
|
|
43435a |
+#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void))(f))
|
|
|
43435a |
--
|
|
|
43435a |
2.26.2
|
|
|
43435a |
|