diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-02 07:57:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-02 07:57:17 +0000 |
commit | 90c4dae08fea47797b3ae574e5dfe35dc66f5631 (patch) | |
tree | 4198e3ccd0a5bab17db2a0f82ee7b6c643115c69 /file.c | |
parent | e193fd8d665567c7f3b827c21a1b77af43e2c391 (diff) |
WinCE patch merged
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -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 <sys/time.h> #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 <utime.h> # 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; |