summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in2
-rw-r--r--dir.c6
-rw-r--r--win32/win32.c4
4 files changed, 11 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 7e4557fb35..5f45b75b3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Apr 2 01:16:24 2001 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * win32/win32.c: use ruby's opendir on mingw32.
+
+ * win32/dir.h, dir.c, Makefile: ditto.
+
Sat Mar 31 04:47:55 2001 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb: add document and example code.
diff --git a/Makefile.in b/Makefile.in
index 0fa87aa44f..163a4156b4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -231,7 +231,7 @@ dl_os2.@OBJEXT@: $(srcdir)/missing/dl_os2.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dl_os2.c
win32.@OBJEXT@: $(srcdir)/win32/win32.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/win32/win32.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/win32 -c $(srcdir)/win32/win32.c
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
diff --git a/dir.c b/dir.c
index 0ef70c6d10..a4299ebdbb 100644
--- a/dir.c
+++ b/dir.c
@@ -26,10 +26,10 @@
#include <unistd.h>
#endif
-#if HAVE_DIRENT_H
+#if defined HAVE_DIRENT_H && !defined NT
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
-#elif HAVE_DIRECT_H
+#elif defined HAVE_DIRECT_H && !defined NT
# include <direct.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
@@ -44,7 +44,7 @@
# if HAVE_NDIR_H
# include <ndir.h>
# endif
-# if defined(NT) && defined(_MSC_VER)
+# if defined(NT)
# include "win32/dir.h"
# endif
#endif
diff --git a/win32/win32.c b/win32/win32.c
index 54ad44ae33..a1f795d97e 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1321,7 +1321,6 @@ NtMakeCmdVector (char *cmdline, char ***vec, int InputCmd)
}
-#if !defined __MINGW32__
//
// UNIX compatible directory access functions for NT
//
@@ -1350,7 +1349,7 @@ opendir(const char *filename)
// check to see if we\'ve got a directory
//
- if ((stat (filename, &sbuf) < 0 ||
+ if ((win32_stat (filename, &sbuf) < 0 ||
sbuf.st_mode & _S_IFDIR == 0) &&
(!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) {
@@ -1507,7 +1506,6 @@ closedir(DIR *dirp)
free(dirp->start);
free(dirp);
}
-#endif
//