diff options
author | Elijah Newren <newren@gmail.com> | 2023-04-22 22:17:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-24 21:47:32 +0200 |
commit | 592fc5b3495bf4ff17252d31109f1d9c0134684b (patch) | |
tree | ec4751e67b760838ea5b5e5237dd9998c9f7e720 /dir.h | |
parent | versioncmp.h: move declarations for versioncmp.c functions from cache.h (diff) | |
download | git-592fc5b3495bf4ff17252d31109f1d9c0134684b.tar.xz git-592fc5b3495bf4ff17252d31109f1d9c0134684b.zip |
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>
Diffstat (limited to 'dir.h')
-rw-r--r-- | dir.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |