From 30d6f079c5de4353e22691aa78c1ee45a3e92ad4 Mon Sep 17 00:00:00 2001 From: jD91mZM2 <me@krake.one> Date: Wed, 5 Sep 2018 17:39:40 +0200 Subject: [PATCH] Add missing dirent macros (fixes #129) --- include/bits/dirent.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/bits/dirent.h b/include/bits/dirent.h index aaa134ea3..6fb5ed37b 100644 --- a/include/bits/dirent.h +++ b/include/bits/dirent.h @@ -1,6 +1,17 @@ #ifndef _BITS_DIRENT_H #define _BITS_DIRENT_H -#define _DIRENT_SIZE (sizeof dirent) +// Shamelessly stolen from musl +#define DT_UNKNOWN 0 +#define DT_FIFO 1 +#define DT_CHR 2 +#define DT_DIR 4 +#define DT_BLK 6 +#define DT_REG 8 +#define DT_LNK 10 +#define DT_SOCK 12 +#define DT_WHT 14 +#define IFTODT(x) ((x)>>12 & 017) +#define DTTOIF(x) ((x)<<12) #endif /* _BITS_DIRENT_H */ -- GitLab