]> git.ipfire.org Git - thirdparty/git.git/commitdiff
dir.h: move DTYPE defines from cache.h
authorElijah Newren <newren@gmail.com>
Sat, 22 Apr 2023 20:17:18 +0000 (20:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Apr 2023 19:47:32 +0000 (12:47 -0700)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
dir.h

diff --git a/cache.h b/cache.h
index 6955745cccdac059115a783ddc6cf6734445c04e..ad741e70bc23409b71d8e9432b8653fb0158e82f 100644 (file)
--- a/cache.h
+++ b/cache.h
 #include "object.h"
 #include "statinfo.h"
 
-#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
-#define DTYPE(de)      ((de)->d_type)
-#else
-#undef DT_UNKNOWN
-#undef DT_DIR
-#undef DT_REG
-#undef DT_LNK
-#define DT_UNKNOWN     0
-#define DT_DIR         1
-#define DT_REG         2
-#define DT_LNK         3
-#define DTYPE(de)      DT_UNKNOWN
-#endif
-
 /*
  * Some mode bits are also used internally for computations.
  *
diff --git a/dir.h b/dir.h
index 3d6c87387e964311783bf749dafc450809b7d512..79b85a01ee40b551268c8ad7bc675fffa66c7f51 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -640,4 +640,19 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
 
        return path_match_flags(path, what | PATH_MATCH_NATIVE);
 }
+
+#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
+#define DTYPE(de)      ((de)->d_type)
+#else
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
+#define DT_UNKNOWN     0
+#define DT_DIR         1
+#define DT_REG         2
+#define DT_LNK         3
+#define DTYPE(de)      DT_UNKNOWN
+#endif
+
 #endif