Correct File::NULL for Windows

This commit is contained in:
Jared Breeden
2015-04-17 15:39:11 -04:00
parent c0738a74c6
commit 36343cf098
2 changed files with 5 additions and 2 deletions
-2
View File
@@ -1,7 +1,5 @@
class File
module Constants
NULL = "/dev/null"
RDONLY = 0
WRONLY = 1
RDWR = 2
+5
View File
@@ -311,4 +311,9 @@ mrb_init_file(mrb_state *mrb)
mrb_define_const(mrb, cnst, "LOCK_UN", mrb_fixnum_value(LOCK_UN));
mrb_define_const(mrb, cnst, "LOCK_NB", mrb_fixnum_value(LOCK_NB));
mrb_define_const(mrb, cnst, "SEPARATOR", mrb_str_new_cstr(mrb, FILE_SEPARATOR));
#if defined(_WIN32) || defined(_WIN64)
mrb_define_const(mrb, cnst, "NULL", mrb_str_new_cstr(mrb, "NUL"));
#else
mrb_define_const(mrb, cnst, "NULL", mrb_str_new_cstr(mrb, "/dev/null"));
#endif
}