shared: redefine G_SOURCE_FUNC

System Internals / NetworkManager - Beniamino Galvani [] - 5 February 2020 13:31 EST

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()')

7f801685b shared: redefine G_SOURCE_FUNC
shared/nm-glib-aux/nm-glib.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)


  • Share