summaryrefslogtreecommitdiff
path: root/src/mm-utils.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-03-01 15:55:22 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-03-01 15:55:22 +0100
commita9611c62793377d8da08e4cb5e9cb71f5afda22e (patch)
treeb40e2b7fe6404f3ce42231480bb15261c0ef68c8 /src/mm-utils.h
parente1372a716e1e87737427f5cc39a7e2b15c982862 (diff)
utils: import ptr array lookup with GEqualFunc from GLib 2.54
This fixes the build when using GLib < 2.54.
Diffstat (limited to 'src/mm-utils.h')
-rw-r--r--src/mm-utils.h14
1 files changed, 14 insertions, 0 deletions
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 */