Blame SOURCES/0009-libosinfo-declare-autocleanup-funcs-with-libosinfo-1.patch

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