diff mbox series

[v2,11/22] dir.h: move DTYPE defines from cache.h

Message ID 673a3ae4fe2cc9a341e33dde6bd756e517f6f658.1682194651.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 592fc5b3495bf4ff17252d31109f1d9c0134684b
Headers show
Series Header cleanups (more splitting of cache.h and simplifying a few other deps) | expand

Commit Message

Elijah Newren April 22, 2023, 8:17 p.m. UTC
From: Elijah Newren <newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 cache.h | 14 --------------
 dir.h   | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/cache.h b/cache.h
index 6955745cccd..ad741e70bc2 100644
--- a/cache.h
+++ b/cache.h
@@ -10,20 +10,6 @@ 
 #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 3d6c87387e9..79b85a01ee4 100644
--- 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