summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-02-05 11:59:49 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-02-05 14:31:46 +0100
commit7f801685b29f4a59a36eff2512dfb5cadd9884a8 (patch)
tree0a1516f9d2574406cb15b9b420a12430a531c2c9
parent9a971849b5c8bae22710cfacfda6db3e6b7c7269 (diff)
downloadNetworkManager-7f801685b29f4a59a36eff2512dfb5cadd9884a8.tar.gz
shared: redefine G_SOURCE_FUNC
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()')
-rw-r--r--shared/nm-glib-aux/nm-glib.h4
1 files 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
/*****************************************************************************/