summaryrefslogtreecommitdiffhomepage
path: root/src/file.c
diff options
context:
space:
mode:
authorJared Breeden <[email protected]>2015-04-17 15:39:11 -0400
committerJared Breeden <[email protected]>2015-04-17 15:39:11 -0400
commit36343cf098e2621696a9ae4ad35e7104f5f6383e (patch)
tree5aa45619f4d473613f488154b29df6467ed6064c /src/file.c
parentc0738a74c6e16194723dd2f9ab8032b9f0976414 (diff)
downloadmruby-36343cf098e2621696a9ae4ad35e7104f5f6383e.tar.gz
mruby-36343cf098e2621696a9ae4ad35e7104f5f6383e.zip
Correct File::NULL for Windows
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/file.c b/src/file.c
index c2419c2cc..b6a3c90c7 100644
--- a/src/file.c
+++ b/src/file.c
@@ -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
}