lib: Use g_file_enumerator_iterate() if available, with fallback

Import `gs_file_enumerator_iterate()` for the next six months or
so...after RHEL 7.3 is released I'm strongly considering hard
requiring 2.46 or so.

Likely at some point we should figure out how to share more "glib
backport" code with NetworkManager at least.

Closes: #341
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-06-21 18:24:17 +00:00
1 parent 9e2763106b
commit 90b9a06277
11 files changed
+98 -24

No files matched your search

+22
View File
@@ -93,4 +93,26 @@ gboolean ot_util_fsync_directory (GFile *dir,
GCancellable *cancellable,
GError **error);
#if !GLIB_CHECK_VERSION(2, 44, 0)
gboolean
ot_file_enumerator_iterate (GFileEnumerator *direnum,
GFileInfo **out_info,
GFile **out_child,
GCancellable *cancellable,
GError **error);
#else
static inline gboolean
ot_file_enumerator_iterate (GFileEnumerator *direnum,
GFileInfo **out_info,
GFile **out_child,
GCancellable *cancellable,
GError **error)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
return (g_file_enumerator_iterate) (direnum, out_info, out_child, cancellable, error);
G_GNUC_END_IGNORE_DEPRECATIONS;
}
#endif
#define g_file_enumerator_iterate ot_file_enumerator_iterate
G_END_DECLS