Changeset 331 for EcnlProtoTool/trunk/mrbgems/mruby-io/src/file.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mrbgems/mruby-io/src/file.c
r321 r331 46 46 #include <pwd.h> 47 47 #endif 48 #if defined(__NEWLIB__)49 #define _MAX_DIR 25350 #define _MAX_DRIVE 251 #define PATH_MAX (_MAX_DRIVE + _MAX_DIR)52 #define MAXPATHLEN (_MAX_DRIVE + _MAX_DIR)53 #endif54 48 55 49 #define FILE_SEPARATOR "/" … … 81 75 mrb_file_s_umask(mrb_state *mrb, mrb_value klass) 82 76 { 83 #if defined(_WIN32) || defined(_WIN64) || defined(__NEWLIB__)77 #if defined(_WIN32) || defined(_WIN64) 84 78 /* nothing to do on windows */ 85 79 return mrb_fixnum_value(0); … … 126 120 dst = mrb_string_value_cstr(mrb, &to); 127 121 if (rename(src, dst) < 0) { 122 #if defined(_WIN32) || defined(_WIN64) 128 123 if (CHMOD(dst, 0666) == 0 && UNLINK(dst) == 0 && rename(src, dst) == 0) { 129 124 return mrb_fixnum_value(0); 130 125 } 126 #endif 131 127 mrb_sys_fail(mrb, mrb_str_to_cstr(mrb, mrb_format(mrb, "(%S, %S)", from, to))); 132 128 } … … 253 249 mrb_file__gethome(mrb_state *mrb, mrb_value klass) 254 250 { 255 #if !defined(_WIN32) && !defined(_WIN64) && !defined(__NEWLIB__)251 #ifndef _WIN32 256 252 mrb_value username; 257 253 int argc; … … 288 284 mrb_file_flock(mrb_state *mrb, mrb_value self) 289 285 { 290 #if defined(_WIN32) || defined(_WIN64) || defined(sun) || defined(__NEWLIB__)286 #if defined(_WIN32) || defined(_WIN64) || defined(sun) 291 287 mrb_raise(mrb, E_NOTIMP_ERROR, "flock is not supported on Illumos/Solaris/Windows"); 292 288 #else … … 322 318 mrb_file_s_symlink(mrb_state *mrb, mrb_value klass) 323 319 { 324 #if defined(_WIN32) || defined(_WIN64) || defined(__NEWLIB__)320 #if defined(_WIN32) || defined(_WIN64) 325 321 mrb_raise(mrb, E_NOTIMP_ERROR, "symlink is not supported on this platform"); 326 322 #else … … 362 358 static mrb_value 363 359 mrb_file_s_readlink(mrb_state *mrb, mrb_value klass) { 364 #if defined(_WIN32) || defined(_WIN64) || defined(__NEWLIB__)360 #if defined(_WIN32) || defined(_WIN64) 365 361 mrb_raise(mrb, E_NOTIMP_ERROR, "readlink is not supported on this platform"); 366 362 return mrb_nil_value(); // unreachable
Note:
See TracChangeset
for help on using the changeset viewer.