summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2015-04-18 06:50:32 +0900
committerTomoyuki Sahara <[email protected]>2015-04-18 06:50:32 +0900
commitae4fc776758c2be579040c2813a2be0c8729ac71 (patch)
tree134f2dff2da72430ca5482b9d5ee3d58a58fd630 /src
parentcfbc8a89953426ec9dd285c0146533d239f7395f (diff)
parent6d6be18d4eadb6a644c4ea7319b336a5a6fdf52b (diff)
downloadmruby-ae4fc776758c2be579040c2813a2be0c8729ac71.tar.gz
mruby-ae4fc776758c2be579040c2813a2be0c8729ac71.zip
Merge pull request #39 from jbreeden/master
Correct File::NULL for Windows
Diffstat (limited to 'src')
-rw-r--r--src/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/file.c b/src/file.c
index c2419c2cc..873c3454f 100644
--- a/src/file.c
+++ b/src/file.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
#if defined(_WIN32) || defined(_WIN64)
+ #define NULL_FILE "NUL"
#define UNLINK _unlink
#define GETCWD _getcwd
#define CHMOD(a, b) 0
@@ -34,6 +35,7 @@
#define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
#include <direct.h>
#else
+ #define NULL_FILE "/dev/null"
#include <unistd.h>
#define UNLINK unlink
#define GETCWD getcwd
@@ -311,4 +313,5 @@ 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));
+ mrb_define_const(mrb, cnst, "NULL", mrb_str_new_cstr(mrb, NULL_FILE));
}