From b14ad267385958a4d202d970bf97fa74fea66636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Mon, 6 Jan 2020 15:56:10 +0000 Subject: [PATCH] util: keep glib compat methods in alphabetical order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Pavel Hrdina Reviewed-by: Daniel Henrique Barboza Signed-off-by: Daniel P. Berrangé --- src/util/glibcompat.c | 27 ++++++++++++++------------- src/util/glibcompat.h | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/util/glibcompat.c b/src/util/glibcompat.c index 9fba54cb79..9710766a2d 100644 --- a/src/util/glibcompat.c +++ b/src/util/glibcompat.c @@ -23,9 +23,22 @@ #include "glibcompat.h" +#undef g_fsync #undef g_strdup_printf #undef g_strdup_vprintf -#undef g_fsync + + +/* Drop when min glib >= 2.63.0 */ +gint +vir_g_fsync(gint fd) +{ +#ifdef G_OS_WIN32 + return _commit(fd); +#else + return fsync(fd); +#endif +} + /* Due to a bug in glib, g_strdup_printf() nor g_strdup_vprintf() * abort on OOM. It's fixed in glib's upstream. Provide our own @@ -53,15 +66,3 @@ vir_g_strdup_vprintf(const char *msg, va_list args) abort(); return ret; } - - -/* Drop when min glib >= 2.63.0 */ -gint -vir_g_fsync(gint fd) -{ -#ifdef G_OS_WIN32 - return _commit(fd); -#else - return fsync(fd); -#endif -} diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h index 7878ad24ed..ce31a4de04 100644 --- a/src/util/glibcompat.h +++ b/src/util/glibcompat.h @@ -21,11 +21,11 @@ #include #include +gint vir_g_fsync(gint fd); char *vir_g_strdup_printf(const char *msg, ...) G_GNUC_PRINTF(1, 2); char *vir_g_strdup_vprintf(const char *msg, va_list args) G_GNUC_PRINTF(1, 0); -gint vir_g_fsync(gint fd); #if !GLIB_CHECK_VERSION(2, 64, 0) # define g_strdup_printf vir_g_strdup_printf