From a9611c62793377d8da08e4cb5e9cb71f5afda22e Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 1 Mar 2021 15:55:22 +0100 Subject: utils: import ptr array lookup with GEqualFunc from GLib 2.54 This fixes the build when using GLib < 2.54. --- src/mm-utils.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mm-utils.h') diff --git a/src/mm-utils.h b/src/mm-utils.h index cdb123cd..613205a3 100644 --- a/src/mm-utils.h +++ b/src/mm-utils.h @@ -12,6 +12,8 @@ * * Singleton support imported from NetworkManager. * (C) Copyright 2014 Red Hat, Inc. + * + * GPtrArray lookup with GEqualFunc imported from GLib 2.48 */ #ifndef MM_UTILS_H @@ -78,4 +80,16 @@ } \ MM_DEFINE_SINGLETON_DESTRUCTOR(TYPE) + +#if !GLIB_CHECK_VERSION(2,54,0) + +/* Pointer Array lookup with a GEqualFunc, imported from GLib 2.54 */ +#define g_ptr_array_find_with_equal_func mm_ptr_array_find_with_equal_func +gboolean mm_ptr_array_find_with_equal_func (GPtrArray *haystack, + gconstpointer needle, + GEqualFunc equal_func, + guint *index_); + +#endif + #endif /* MM_UTILS_H */ -- cgit v1.2.3-70-g09d2