fix compilation for glib < 2.40

closes #1122

Change-Id: I2be6645a088d0114da2ff1a8190c3e135903f510
pull/1126/head
Richard Fuchs 5 years ago
parent 8097f9632f
commit f0a29d0c5c

@ -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.

Loading…
Cancel
Save