summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authoruema2 <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-15 03:18:08 +0000
committeruema2 <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-15 03:18:08 +0000
commitb19e36a214a864572baee3643ddb369cfeb94d77 (patch)
tree5bd7fecbef75dd74f4810cda212bf989f43a95a3 /dir.c
parentc476b6e05c1cae6de5d24b823e676566ae27de6c (diff)
* configure.in, defines.h, dir.c, dir.h, dln.c, error.c,
eval.c, file.c, hash.c, io.c, main.c, missing.c, process.c, ruby.c, rubysig.h, signal.c, st.c, util.c, util.h, bcc/Makefile.sub, win32/Makefile.sub, win32/win32.h, ext/Win32API/Win32API.c, ext/socket/getaddrinfo.c, ext/socket/getnameinfo.c, ext/socket/socket.c, ext/tcltklib/stubs.c : replace "NT" with "_WIN32", add DOSISH_DRIVE_LETTER * wince/exe.mak : delete \r at the end of lines. * wince/mswince-ruby17.def : delete rb_obj_become git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/dir.c b/dir.c
index 065dacda81..779407131e 100644
--- a/dir.c
+++ b/dir.c
@@ -21,10 +21,10 @@
#include <unistd.h>
#endif
-#if defined HAVE_DIRENT_H && !defined NT && !defined _WIN32_WCE
+#if defined HAVE_DIRENT_H && !defined _WIN32
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
-#elif defined HAVE_DIRECT_H && !defined NT && !defined _WIN32_WCE
+#elif defined HAVE_DIRECT_H && !defined _WIN32
# include <direct.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
@@ -39,7 +39,7 @@
# if HAVE_NDIR_H
# include <ndir.h>
# endif
-# if defined(NT) || defined(_WIN32_WCE)
+# ifdef _WIN32
# include "win32/dir.h"
# endif
#endif
@@ -79,10 +79,7 @@ char *strchr _((char*,char));
# define CharNext(p) ((p) + 1)
# endif
#endif
-#ifdef _WIN32_WCE
-#undef CharNext
-#define CharNext CharNextA
-#endif
+
#if defined DOSISH
#define isdirsep(c) ((c) == '/' || (c) == '\\')
static char *
@@ -538,7 +535,7 @@ dir_s_mkdir(argc, argv, obj)
SafeStringValue(path);
rb_secure(2);
-#if !defined(NT) && !defined(_WIN32_WCE)
+#ifndef _WIN32
if (mkdir(RSTRING(path)->ptr, mode) == -1)
rb_sys_fail(RSTRING(path)->ptr);
#else
@@ -607,7 +604,7 @@ extract_path(p, pend)
alloc = ALLOC_N(char, len+1);
memcpy(alloc, p, len);
if (len > 1 && pend[-1] == '/'
-#if defined DOSISH
+#if defined DOSISH_DRIVE_LETTER
&& pend[-2] != ':'
#endif
) {
@@ -766,10 +763,10 @@ glob_helper(path, sub, flags, func, arg)
break;
}
-#if defined DOSISH
+#if defined DOSISH_DRIVE_LETTER
#define BASE (*base && !((isdirsep(*base) && !base[1]) || (base[1] == ':' && isdirsep(base[2]) && !base[3])))
#else
-#define BASE (*base && !(*base == '/' && !base[1]))
+#define BASE (*base && !(isdirsep(*base) && !base[1]))
#endif
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {