|
|
62f9b7 |
From a8f3d2b2e87aead9f6a1db66dccebb6239ddf004 Mon Sep 17 00:00:00 2001
|
|
|
62f9b7 |
From: Pino Toscano <ptoscano@redhat.com>
|
|
|
62f9b7 |
Date: Fri, 19 Jun 2020 17:57:36 +0200
|
|
|
62f9b7 |
Subject: [PATCH] libosinfo: declare autocleanup funcs with libosinfo < 1.8.0
|
|
|
62f9b7 |
|
|
|
62f9b7 |
libosinfo 1.8.0 declares them automatically for all of its classes, so
|
|
|
62f9b7 |
there is no need to declare ours. This requires fixing the definition of
|
|
|
62f9b7 |
the IS_LIBOSINFO_VERSION macro to wrap its body in brackets.
|
|
|
62f9b7 |
|
|
|
62f9b7 |
While in the process, simplify the workaround for a related bug by
|
|
|
62f9b7 |
removing a now-useless check.
|
|
|
62f9b7 |
|
|
|
62f9b7 |
(cherry picked from commit c1caf7132000a4560c3e20c2753978e8dd10036a)
|
|
|
62f9b7 |
---
|
|
|
62f9b7 |
v2v/libosinfo-c.c | 8 +++++++-
|
|
|
62f9b7 |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
62f9b7 |
|
|
|
62f9b7 |
diff --git a/v2v/libosinfo-c.c b/v2v/libosinfo-c.c
|
|
|
62f9b7 |
index 1ab6bb4d..497840c2 100644
|
|
|
62f9b7 |
--- a/v2v/libosinfo-c.c
|
|
|
62f9b7 |
+++ b/v2v/libosinfo-c.c
|
|
|
62f9b7 |
@@ -40,12 +40,18 @@
|
|
|
62f9b7 |
#define V2V_LIBOSINFO_VERSION_HEX \
|
|
|
62f9b7 |
MAKE_VERSION_HEX(OSINFO_MAJOR_VERSION, OSINFO_MINOR_VERSION, OSINFO_MICRO_VERSION)
|
|
|
62f9b7 |
#define IS_LIBOSINFO_VERSION(maj, min, mic) \
|
|
|
62f9b7 |
- V2V_LIBOSINFO_VERSION_HEX >= MAKE_VERSION_HEX(maj, min, mic)
|
|
|
62f9b7 |
+ (V2V_LIBOSINFO_VERSION_HEX >= MAKE_VERSION_HEX(maj, min, mic))
|
|
|
62f9b7 |
|
|
|
62f9b7 |
+/*
|
|
|
62f9b7 |
+ * libosinfo 1.8.0 provides auto-cleanup functions for all its classes,
|
|
|
62f9b7 |
+ * so avoid declaring our own.
|
|
|
62f9b7 |
+ */
|
|
|
62f9b7 |
+#if !IS_LIBOSINFO_VERSION(1, 8, 0)
|
|
|
62f9b7 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(OsinfoFilter, g_object_unref)
|
|
|
62f9b7 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(OsinfoLoader, g_object_unref)
|
|
|
62f9b7 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(OsinfoList, g_object_unref)
|
|
|
62f9b7 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(OsinfoOsList, g_object_unref)
|
|
|
62f9b7 |
+#endif
|
|
|
62f9b7 |
|
|
|
62f9b7 |
typedef OsinfoDb *OsinfoDb_t;
|
|
|
62f9b7 |
typedef OsinfoOs *OsinfoOs_t;
|
|
|
62f9b7 |
--
|
|
|
62f9b7 |
2.27.0
|
|
|
62f9b7 |
|