diff --git a/libfwupdplugin/fu-device.c b/libfwupdplugin/fu-device.c index c754941b9..65c3dcc53 100644 --- a/libfwupdplugin/fu-device.c +++ b/libfwupdplugin/fu-device.c @@ -173,9 +173,11 @@ fu_device_add_possible_plugin (FuDevice *self, const gchar *plugin) g_return_if_fail (plugin != NULL); /* add if it does not already exist */ +#if GLIB_CHECK_VERSION(2,54,3) if (g_ptr_array_find_with_equal_func (priv->possible_plugins, plugin, g_str_equal, NULL)) return; +#endif g_ptr_array_add (priv->possible_plugins, g_strdup (plugin)); } diff --git a/src/fu-engine.c b/src/fu-engine.c index 85d896b4e..413dac20a 100644 --- a/src/fu-engine.c +++ b/src/fu-engine.c @@ -4481,9 +4481,11 @@ fu_engine_get_releases_for_device (FuEngine *self, for (guint i = 0; i < releases->len; i++) { FwupdRelease *rel_tmp = FWUPD_RELEASE (g_ptr_array_index (releases, i)); const gchar *branch_tmp = fu_engine_get_branch_fallback (fwupd_release_get_branch (rel_tmp)); +#if GLIB_CHECK_VERSION(2,54,3) if (g_ptr_array_find_with_equal_func (branches, branch_tmp, g_str_equal, NULL)) continue; +#endif g_ptr_array_add (branches, g_strdup (branch_tmp)); } if (branches->len > 1) diff --git a/src/fu-tool.c b/src/fu-tool.c index 3825ab3bd..318c38e64 100644 --- a/src/fu-tool.c +++ b/src/fu-tool.c @@ -2572,9 +2572,11 @@ fu_util_switch_branch (FuUtilPrivate *priv, gchar **values, GError **error) for (guint i = 0; i < rels->len; i++) { FwupdRelease *rel_tmp = g_ptr_array_index (rels, i); const gchar *branch_tmp = fu_util_release_get_branch (rel_tmp); +#if GLIB_CHECK_VERSION(2,54,3) if (g_ptr_array_find_with_equal_func (branches, branch_tmp, g_str_equal, NULL)) continue; +#endif g_ptr_array_add (branches, g_strdup (branch_tmp)); } diff --git a/src/fu-util.c b/src/fu-util.c index 7bef47729..b1239eec7 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -1923,9 +1923,11 @@ fu_util_switch_branch (FuUtilPrivate *priv, gchar **values, GError **error) for (guint i = 0; i < rels->len; i++) { FwupdRelease *rel_tmp = g_ptr_array_index (rels, i); const gchar *branch_tmp = fu_util_release_get_branch (rel_tmp); +#if GLIB_CHECK_VERSION(2,54,3) if (g_ptr_array_find_with_equal_func (branches, branch_tmp, g_str_equal, NULL)) continue; +#endif g_ptr_array_add (branches, g_strdup (branch_tmp)); }