代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1ac928729853d29d030944ece5e10db69d54267d Mon Sep 17 00:00:00 2001
From: mayunlong <mayunlong6@huawei.com>
Date: Tue, 14 Feb 2023 19:09:08 +0800
Subject: [PATCH] glibcompat: Provide implementation for G_GNUC_NO_INLINE
Currently, we require glib-2.56.0 at minimum (because of RHEL-8)
but we use G_GNUC_NO_INLINE which was introduced in 2.58.0. While
we provide an implementation for older versions, where the macro
does not exists, it's a bit more tricky than that. Since we
define GLIB_VERSION_MAX_ALLOWED we would get a compile time error
when trying to use something too new, except for G_GNUC_NO_INLINE
which was intentionally not marked as
GLIB_AVAILABLE_MACRO_IN_2_58. But this is about to change with
glib-2.73.2 (which contains commit [1]).
At the same time, we can't just bump glib and thus we have to
provide an alternative implementation without the version
annotation.
1: https://gitlab.gnome.org/GNOME/glib/-/commit/a6f8fe071e44b0145619c21f3bfbc90c56ab805e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
---
src/internal.h | 12 ------------
src/util/glibcompat.h | 9 +++++++++
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/internal.h b/src/internal.h
index 302fddba34..440f01d370 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -94,18 +94,6 @@
# endif
#endif
-/**
- * G_GNUC_NO_INLINE:
- *
- * Force compiler not to inline a method. Should be used if
- * the method need to be overridable by test mocks.
- *
- * TODO: Remove after upgrading to GLib >= 2.58
- */
-#ifndef G_GNUC_NO_INLINE
-# define G_GNUC_NO_INLINE __attribute__((__noinline__))
-#endif
-
/**
* ATTRIBUTE_PACKED
*
diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h
index 6f50a76f3c..15d3266686 100644
--- a/src/util/glibcompat.h
+++ b/src/util/glibcompat.h
@@ -37,3 +37,12 @@ char *vir_g_strdup_vprintf(const char *msg, va_list args)
#define g_canonicalize_filename vir_g_canonicalize_filename
#undef g_fsync
#define g_fsync vir_g_fsync
+
+/* Intentionally redefine macro so that it's not marked as available in 2.58
+ * and newer. Drop when bumping to 2.58 or newer. */
+#undef G_GNUC_NO_INLINE
+#if g_macro__has_attribute(__noinline__)
+# define G_GNUC_NO_INLINE __attribute__ ((__noinline__))
+#else
+# define G_GNUC_NO_INLINE
+#endif
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。