* include/dirent.h (dirent): Make d_name and array instead of a pointer.
* mingwex/dirent.c: Modifications througout to fill d_name array. * Makefile.in (LIBS): Add new MSVCRT libraries libmsvcr70 and libmsvcr71, including debug versions. (msvcr70.def, msvcr70d.def, msvcr71.def, msvcr71.def): New targets.
This commit is contained in:
parent
1c906df21f
commit
2302957c53
|
@ -157,8 +157,15 @@ MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \
|
||||||
MOLD_OBJS = isascii.o iscsym.o iscsymf.o toascii.o \
|
MOLD_OBJS = isascii.o iscsym.o iscsymf.o toascii.o \
|
||||||
strcasecmp.o strncasecmp.o wcscmpi.o
|
strcasecmp.o strncasecmp.o wcscmpi.o
|
||||||
|
|
||||||
LIBS = libcrtdll.a libmsvcrt.a libmsvcrtd.a libmingw32.a \
|
LIBS = libcrtdll.a \
|
||||||
libcoldname.a libmoldname.a libmoldnamed.a $(LIBM_A) libmingwthrd.a
|
libmsvcrt.a libmsvcrtd.a \
|
||||||
|
libmsvcr70.a libmsvcr70d.a \
|
||||||
|
libmsvcr71.a libmsvcr71d.a \
|
||||||
|
libmingw32.a \
|
||||||
|
libcoldname.a \
|
||||||
|
libmoldname.a libmoldnamed.a \
|
||||||
|
$(LIBM_A) \
|
||||||
|
libmingwthrd.a
|
||||||
|
|
||||||
DLLS = $(THREAD_DLL_NAME)
|
DLLS = $(THREAD_DLL_NAME)
|
||||||
|
|
||||||
|
@ -234,7 +241,10 @@ libmingw32.a: $(MINGW_OBJS)
|
||||||
$(AR) rc $@ $(MINGW_OBJS)
|
$(AR) rc $@ $(MINGW_OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
msvcrt.def msvcrtd.def: msvcrt.def.in
|
msvcrt.def msvcrtd.def \
|
||||||
|
msvcr70.def msvcr70d.def \
|
||||||
|
msvcr71.def msvcr71d.def \
|
||||||
|
: msvcrt.def.in
|
||||||
$(CC) -DRUNTIME=$(basename $(notdir $@)) \
|
$(CC) -DRUNTIME=$(basename $(notdir $@)) \
|
||||||
-D__FILENAME__=$@ \
|
-D__FILENAME__=$@ \
|
||||||
-D__MSVCRT__ -C -E -P \
|
-D__MSVCRT__ -C -E -P \
|
||||||
|
|
|
@ -42,9 +42,7 @@ struct dirent
|
||||||
long d_ino; /* Always zero. */
|
long d_ino; /* Always zero. */
|
||||||
unsigned short d_reclen; /* Always zero. */
|
unsigned short d_reclen; /* Always zero. */
|
||||||
unsigned short d_namlen; /* Length of name in d_name. */
|
unsigned short d_namlen; /* Length of name in d_name. */
|
||||||
char* d_name; /* File name. */
|
char d_name[FILENAME_MAX]; /* File name. */
|
||||||
/* NOTE: The name in the dirent structure points to the name in the
|
|
||||||
* finddata_t structure in the DIR. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -92,7 +90,7 @@ struct _wdirent
|
||||||
long d_ino; /* Always zero. */
|
long d_ino; /* Always zero. */
|
||||||
unsigned short d_reclen; /* Always zero. */
|
unsigned short d_reclen; /* Always zero. */
|
||||||
unsigned short d_namlen; /* Length of name in d_name. */
|
unsigned short d_namlen; /* Length of name in d_name. */
|
||||||
wchar_t* d_name; /* File name. */
|
wchar_t d_name[FILENAME_MAX]; /* File name. */
|
||||||
/* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
|
/* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ _topendir (const _TCHAR *szPath)
|
||||||
nd->dd_dir.d_ino = 0;
|
nd->dd_dir.d_ino = 0;
|
||||||
nd->dd_dir.d_reclen = 0;
|
nd->dd_dir.d_reclen = 0;
|
||||||
nd->dd_dir.d_namlen = 0;
|
nd->dd_dir.d_namlen = 0;
|
||||||
nd->dd_dir.d_name = nd->dd_dta.name;
|
memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
|
||||||
|
|
||||||
return nd;
|
return nd;
|
||||||
}
|
}
|
||||||
|
@ -137,13 +137,6 @@ _treaddir (_TDIR * dirp)
|
||||||
return (struct _tdirent *) 0;
|
return (struct _tdirent *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dirp->dd_dir.d_name != dirp->dd_dta.name)
|
|
||||||
{
|
|
||||||
/* The structure does not seem to be set up correctly. */
|
|
||||||
errno = EINVAL;
|
|
||||||
return (struct _tdirent *) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dirp->dd_stat < 0)
|
if (dirp->dd_stat < 0)
|
||||||
{
|
{
|
||||||
/* We have already returned all files in the directory
|
/* We have already returned all files in the directory
|
||||||
|
@ -190,7 +183,8 @@ _treaddir (_TDIR * dirp)
|
||||||
/* Successfully got an entry. Everything about the file is
|
/* Successfully got an entry. Everything about the file is
|
||||||
* already appropriately filled in except the length of the
|
* already appropriately filled in except the length of the
|
||||||
* file name. */
|
* file name. */
|
||||||
dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dir.d_name);
|
dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name);
|
||||||
|
_tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
|
||||||
return &dirp->dd_dir;
|
return &dirp->dd_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue