dir.h: move DTYPE defines from cache.h
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Apr 22, 2023 at 20:17 UTC
592fc5b3495bf4ff17252d31109f1d9c0134684b
2 files changed
+15
-14
cache.h
-14
@@ -10,20 +10,6 @@
10
#include "object.h"
11
#include "statinfo.h"
12
13
-#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
14
-#define DTYPE(de) ((de)->d_type)
15
-#else
16
-#undef DT_UNKNOWN
17
-#undef DT_DIR
18
-#undef DT_REG
19
-#undef DT_LNK
20
-#define DT_UNKNOWN 0
21
-#define DT_DIR 1
22
-#define DT_REG 2
23
-#define DT_LNK 3
24
-#define DTYPE(de) DT_UNKNOWN
25
-#endif
26
-
13
/*
14
* Some mode bits are also used internally for computations.
15
*
dir.h
+15
@@ -640,4 +640,19 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
640
641
return path_match_flags(path, what | PATH_MATCH_NATIVE);
642
}
643
+
644
+#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
645
+#define DTYPE(de) ((de)->d_type)
646
+#else
647
+#undef DT_UNKNOWN
648
+#undef DT_DIR
649
+#undef DT_REG
650
+#undef DT_LNK
651
+#define DT_UNKNOWN 0
652
+#define DT_DIR 1
653
+#define DT_REG 2
654
+#define DT_LNK 3
655
+#define DTYPE(de) DT_UNKNOWN
656
+#endif
657
+
658
#endif