Skip to content

Commit 1bff6a9

Browse files
committed
Merge branch 'as/dtype-compilation-fix'
Compilation fix for platforms without D_TYPE in struct dirent. * as/dtype-compilation-fix: statinfo.h: move DTYPE defines from dir.h
2 parents 644591b + 03bf92b commit 1bff6a9

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

dir.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -641,18 +641,4 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
641641
return path_match_flags(path, what | PATH_MATCH_NATIVE);
642642
}
643643

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-
658644
#endif

statinfo.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@ struct stat_data {
2121
unsigned int sd_size;
2222
};
2323

24+
#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
25+
#define DTYPE(de) ((de)->d_type)
26+
#else
27+
#undef DT_UNKNOWN
28+
#undef DT_DIR
29+
#undef DT_REG
30+
#undef DT_LNK
31+
#define DT_UNKNOWN 0
32+
#define DT_DIR 1
33+
#define DT_REG 2
34+
#define DT_LNK 3
35+
#define DTYPE(de) DT_UNKNOWN
36+
#endif
37+
2438
#endif

0 commit comments

Comments
 (0)