summaryrefslogtreecommitdiffstats
path: root/src/dir.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dir.h')
-rw-r--r--src/dir.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dir.h b/src/dir.h
index 18d907e..bbba071 100644
--- a/src/dir.h
+++ b/src/dir.h
@@ -8,6 +8,7 @@
#ifndef BFS_DIR_H
#define BFS_DIR_H
+#include "prelude.h"
#include <sys/types.h>
/**
@@ -15,7 +16,11 @@
* libc's readdir().
*/
#ifndef BFS_USE_GETDENTS
-# define BFS_USE_GETDENTS (__linux__ || __FreeBSD__)
+# if BFS_HAS_POSIX_GETDENTS
+# define BFS_USE_GETDENTS true
+# elif __linux__ || __FreeBSD__
+# define BFS_USE_GETDENTS (BFS_HAS_GETDENTS || BFS_HAS_GETDENTS64 | BFS_HAS_GETDENTS64_SYSCALL)
+# endif
#endif
/**
@@ -152,7 +157,7 @@ int bfs_closedir(struct bfs_dir *dir);
* Whether the bfs_unwrapdir() function is supported.
*/
#ifndef BFS_USE_UNWRAPDIR
-# define BFS_USE_UNWRAPDIR (BFS_USE_GETDENTS || __FreeBSD__)
+# define BFS_USE_UNWRAPDIR (BFS_USE_GETDENTS || BFS_HAS_FDCLOSEDIR)
#endif
#if BFS_USE_UNWRAPDIR