[glib/wip/meson: 35/35] glib: Only define g_dir_new_from_dirp() on G_OS_UNIX
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/meson: 35/35] glib: Only define g_dir_new_from_dirp() on G_OS_UNIX
- Date: Mon, 8 May 2017 12:36:52 +0000 (UTC)
commit f4750f7526a1f333b0a1bb7f6d38c882c8c97ede
Author: Nirbheek Chauhan <nirbheek centricular com>
Date: Wed Apr 5 23:12:35 2017 +0530
glib: Only define g_dir_new_from_dirp() on G_OS_UNIX
This will make incorrect usage obvious at compile-time instead of
punting it to run-time.
glib/gdir.c | 6 ++----
glib/glib-private.c | 2 ++
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/gdir.c b/glib/gdir.c
index 4f73837..d6bd290 100644
--- a/glib/gdir.c
+++ b/glib/gdir.c
@@ -176,10 +176,10 @@ g_dir_open (const gchar *path,
*
* Since: 2.38
**/
+#ifdef G_OS_UNIX
GDir *
g_dir_new_from_dirp (gpointer dirp)
{
-#ifdef G_OS_UNIX
GDir *dir;
g_return_val_if_fail (dirp != NULL, NULL);
@@ -188,10 +188,8 @@ g_dir_new_from_dirp (gpointer dirp)
dir->dirp = dirp;
return dir;
-#else
- g_assert_not_reached ();
-#endif
}
+#endif
/**
* g_dir_read_name:
diff --git a/glib/glib-private.c b/glib/glib-private.c
index 3dbf744..bd36d41 100644
--- a/glib/glib-private.c
+++ b/glib/glib-private.c
@@ -45,7 +45,9 @@ glib__private__ (void)
g_main_context_new_with_next_id,
g_dir_open_with_errno,
+#ifdef G_OS_UNIX
g_dir_new_from_dirp,
+#endif
glib_init,
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]