From 90c4dae08fea47797b3ae574e5dfe35dc66f5631 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 2 Dec 2002 07:57:17 +0000 Subject: WinCE patch merged git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 04af8db766..ebfdcc5735 100644 --- a/file.c +++ b/file.c @@ -12,7 +12,7 @@ **********************************************************************/ -#ifdef NT +#if defined NT || defined _WIN32_WCE #include "missing/file.h" #endif @@ -43,12 +43,12 @@ int flock _((int, int)); #ifdef HAVE_SYS_TIME_H # include #else -#ifndef NT +#if !defined(NT) && !defined(_WIN32_WCE) struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; -#endif /* NT */ +#endif /* NT, WINCE */ #endif VALUE rb_time_new _((time_t, time_t)); @@ -76,6 +76,11 @@ char *strrchr _((const char*,const char)); #define lstat(path,st) stat(path,st) #endif +#ifdef _WIN32_WCE +#undef CharNext +#define CharNext CharNextA +#endif + VALUE rb_cFile; VALUE rb_mFileTest; static VALUE rb_cStat; @@ -110,7 +115,7 @@ rb_file_path(obj) return rb_str_new2(fptr->path); } -#ifdef NT +#if defined NT || defined _WIN32_WCE #include "missing/file.h" #endif @@ -440,7 +445,7 @@ static int group_member(gid) GETGROUPS_T gid; { -#if !defined(NT) +#if !defined(NT) && !defined(_WIN32_WCE) if (getgid() == gid) return Qtrue; @@ -780,7 +785,7 @@ static VALUE test_grpowned(obj, fname) VALUE obj, fname; { -#ifndef NT +#if !defined(NT) && !defined(_WIN32_WCE) struct stat st; if (rb_stat(fname, &st) < 0) return Qfalse; @@ -1115,7 +1120,7 @@ rb_file_chown(obj, owner, group) rb_secure(2); GetOpenFile(obj, fptr); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(__EMX__) +#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(__EMX__) || defined(_WIN32_WCE) if (!fptr->path) return Qnil; if (chown(fptr->path, NUM2INT(owner), NUM2INT(group)) == -1) rb_sys_fail(fptr->path); @@ -1208,7 +1213,7 @@ rb_file_s_utime(argc, argv) #else #ifndef HAVE_UTIME_H -# ifdef NT +# if defined NT || defined _WIN32_WCE # if defined(__BORLANDC__) # include # else @@ -1711,7 +1716,7 @@ rb_file_s_truncate(klass, path, len) { int tmpfd; -# if defined(NT) +# if defined(NT) || defined(_WIN32_WCE) if ((tmpfd = open(RSTRING(path)->ptr, O_RDWR)) < 0) { rb_sys_fail(RSTRING(path)->ptr); } @@ -2136,7 +2141,7 @@ static VALUE rb_stat_grpowned(obj) VALUE obj; { -#ifndef NT +#if !defined(NT) && !defined(_WIN32_WCE) if (get_stat(obj)->st_gid == getegid()) return Qtrue; #endif return Qfalse; -- cgit v1.2.3