[evil] use our own dirent structure and implementation instead of

mingw one.

SVN revision: 53773
This commit is contained in:
Vincent Torri 2010-10-22 16:47:28 +00:00
parent 9c5ce8345e
commit 38f3d012d6
4 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2010-10-22 Vincent Torri <doursse at users dot sf dot net>
* src/lib/Makefile.am:
* src/lib/dirent.h:
* src/lib/evil_dirent.c:
use our own dirent structure and implementation instead of
mingw one.
2010-09-14 Vincent Torri <doursse at users dot sf dot net>
* src/lib/Makefile.am:

View File

@ -18,7 +18,7 @@ evil_time.h \
evil_unistd.h \
evil_util.h
nobase_include_HEADERS = pwd.h sys/mman.h fnmatch.h
nobase_include_HEADERS = pwd.h sys/mman.h fnmatch.h dirent.h
if EVIL_HAVE_WINCE

View File

@ -22,13 +22,16 @@
# include <wchar.h>
#endif
#define DT_UNKNOWN 0
#define DT_DIR 4
typedef struct DIR DIR;
struct dirent
{
char d_name[260 + 1];
int d_mode;
char d_name[260 + 1];
int d_mode;
unsigned char d_type;
};

View File

@ -137,6 +137,11 @@ DIR *opendir(char const *name)
#endif
dir->dirent.d_mode = (int)dir->data.dwFileAttributes;
if (dir->data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
dir->dirent.d_type = DT_DIR;
else
dir->dirent.d_type = DT_UNKNOWN;
return dir;
}