utils: import ptr array lookup with GEqualFunc from GLib 2.54

This fixes the build when using GLib < 2.54.
This commit is contained in:
Aleksander Morgado
2021-03-01 15:55:22 +01:00
parent e1372a716e
commit a9611c6279
5 changed files with 64 additions and 1 deletions
+14
View File
@@ -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 */