From 14c136443caf455498b9bf584fad0d49c2496b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Mon, 6 Jan 2020 11:42:17 +0000 Subject: [PATCH] util: always replace g_fsync usage with our wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit g_fsync was introduced in 2.63 which is newer than our minimum glib version. A future commit will introduce compile time checking of API versions to prevent accidental usage of APIs from glib newer than our min declared. To avoid triggering this warning, however, we need to ensure that we always use our wrapper function via glibcompat.c, which will disable the API version warnings. Reviewed-by: Pavel Hrdina Reviewed-by: Daniel Henrique Barboza Signed-off-by: Daniel P. Berrangé --- src/util/glibcompat.c | 1 + src/util/glibcompat.h | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/glibcompat.c b/src/util/glibcompat.c index 4ebefb4478..9fba54cb79 100644 --- a/src/util/glibcompat.c +++ b/src/util/glibcompat.c @@ -55,6 +55,7 @@ vir_g_strdup_vprintf(const char *msg, va_list args) } +/* Drop when min glib >= 2.63.0 */ gint vir_g_fsync(gint fd) { diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h index d6b83f4b93..7878ad24ed 100644 --- a/src/util/glibcompat.h +++ b/src/util/glibcompat.h @@ -32,6 +32,5 @@ gint vir_g_fsync(gint fd); # define g_strdup_vprintf vir_g_strdup_vprintf #endif -#if !GLIB_CHECK_VERSION(2, 63, 0) -# define g_fsync vir_g_fsync -#endif +#undef g_fsync +#define g_fsync vir_g_fsync -- GitLab