Skip to content

Commit 592fc5b

Browse files
newrengitster
authored andcommitted
dir.h: move DTYPE defines from cache.h
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3467663 commit 592fc5b

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

cache.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@
1010
#include "object.h"
1111
#include "statinfo.h"
1212

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-
2713
/*
2814
* Some mode bits are also used internally for computations.
2915
*

dir.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,4 +640,19 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
640640

641641
return path_match_flags(path, what | PATH_MATCH_NATIVE);
642642
}
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+
643658
#endif

0 commit comments

Comments
 (0)