From 7f801685b29f4a59a36eff2512dfb5cadd9884a8 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 5 Feb 2020 11:59:49 +0100 Subject: [PATCH] shared: redefine G_SOURCE_FUNC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit G_SOURCE_FUNC has attribute GLIB_AVAILABLE_MACRO_IN_2_58, which means that the compiler will emit a warning when GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_58. We currently define GLIB_VERSION_MAX_ALLOWED as GLIB_VERSION_2_40. Redefine the macro to fix the following build error when using glib >= 2.63.5 (the version in which the attribute was added): CC shared/nm-glib-aux/libnm_glib_aux_la-nm-shared-utils.lo shared/nm-glib-aux/nm-shared-utils.c: In function ‘nm_g_unix_fd_source_new’: shared/nm-glib-aux/nm-shared-utils.c:3679:13: error: Not available before [-Werror] 3679 | g_source_set_callback (source, G_SOURCE_FUNC (source_func), user_data, destroy_notify); Fixes: 9c5741ccd2b8 ('shared/nm-glib: add compat implementation for G_SOURCE_FUNC()') --- shared/nm-glib-aux/nm-glib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/nm-glib-aux/nm-glib.h b/shared/nm-glib-aux/nm-glib.h index 4043ec2240..93513a964f 100644 --- a/shared/nm-glib-aux/nm-glib.h +++ b/shared/nm-glib-aux/nm-glib.h @@ -569,9 +569,9 @@ _nm_g_value_unset (GValue *value) /*****************************************************************************/ -#if !GLIB_CHECK_VERSION (2, 57, 2) +/* G_SOURCE_FUNC was added in 2.57.2. */ +#undef G_SOURCE_FUNC #define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f)) -#endif /*****************************************************************************/