From f0a29d0c5c4c95cb3c47279c562f41b22f6c9146 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 1 Dec 2020 16:02:48 -0500 Subject: [PATCH] fix compilation for glib < 2.40 closes #1122 Change-Id: I2be6645a088d0114da2ff1a8190c3e135903f510 --- lib/auxlib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/auxlib.c b/lib/auxlib.c index 6d026c710..b3d95ad5c 100644 --- a/lib/auxlib.c +++ b/lib/auxlib.c @@ -128,6 +128,7 @@ void config_load(int *argc, char ***argv, GOptionEntry *app_entries, const char const char *use_config; int fatal = 0; AUTO_CLEANUP(char **saved_argv, free_gvbuf) = g_strdupv(*argv); + int saved_argc = *argc; rtpe_common_config_ptr = cconfig; @@ -254,7 +255,11 @@ void config_load(int *argc, char ***argv, GOptionEntry *app_entries, const char // process CLI arguments again so they override options from the config file c = g_option_context_new(description); g_option_context_add_main_entries(c, entries, NULL); +#if !GLIB_CHECK_VERSION(2,40,0) g_option_context_parse_strv(c, &saved_argv, &er); +#else + g_option_context_parse(c, &saved_argc, &saved_argv, &er); +#endif // finally go through our list again to look for strings that were // overwritten, and free the old values.