summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 76c108a4a9..8c6d6fea56 100644
--- a/dir.c
+++ b/dir.c
@@ -187,12 +187,18 @@ has_nonascii(const char *ptr, size_t len)
# define IF_NORMALIZE_UTF8PATH(something) /* nothing */
#endif
-#ifndef IFTODT
+#if defined(IFTODT) && defined(DT_UNKNOWN)
+# define EMULATE_IFTODT 0
+#else
+# define EMULATE_IFTODT 1
+#endif
+
+#if EMULATE_IFTODT
# define IFTODT(m) (((m) & S_IFMT) / ((~S_IFMT & (S_IFMT-1)) + 1))
#endif
typedef enum {
-#ifdef DT_UNKNOWN
+#if !EMULATE_IFTODT
path_exist = DT_UNKNOWN,
path_directory = DT_DIR,
path_regular = DT_REG,