summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTerence Lee <[email protected]>2015-08-02 17:21:08 +0200
committerTerence Lee <[email protected]>2015-08-02 17:35:07 +0200
commitec4982b2d339a2bd4e45adcee1b5d2bb1d890f6f (patch)
tree8e65858af76200658428e51d97fff5427070ebbe
parent2d1134e9ea32080b96ca141abb06791bd98e5261 (diff)
downloadmruby-ec4982b2d339a2bd4e45adcee1b5d2bb1d890f6f.tar.gz
mruby-ec4982b2d339a2bd4e45adcee1b5d2bb1d890f6f.zip
define PATH_SEPARATOR
-rw-r--r--src/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/file.c b/src/file.c
index 873c3454f..10d6b2268 100644
--- a/src/file.c
+++ b/src/file.c
@@ -47,6 +47,11 @@
#endif
#define FILE_SEPARATOR "/"
+#if defined(_WIN32) || defined(_WIN64)
+ #define PATH_SEPARATOR ";"
+#else
+ #define PATH_SEPARATOR ":"
+#endif
#ifndef LOCK_SH
#define LOCK_SH 1
@@ -313,5 +318,7 @@ 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, "PATH_SEPARATOR", mrb_str_new_cstr(mrb, PATH_SEPARATOR));
mrb_define_const(mrb, cnst, "NULL", mrb_str_new_cstr(mrb, NULL_FILE));
+
}