summaryrefslogtreecommitdiffhomepage
path: root/src/io.c
diff options
context:
space:
mode:
authorPaolo Bosetti <[email protected]>2013-12-10 14:34:26 +0100
committerPaolo Bosetti <[email protected]>2013-12-10 14:34:26 +0100
commit23afaf02dc146346da823f85cea7a51263d0e2b7 (patch)
treef8eb81a88486f024a1473f37db85eadc964da0d8 /src/io.c
parent5a59fd3a5c83395847448db333c9df9d253a158c (diff)
downloadmruby-23afaf02dc146346da823f85cea7a51263d0e2b7.tar.gz
mruby-23afaf02dc146346da823f85cea7a51263d0e2b7.zip
Made compatible with VisualStudio
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/io.c b/src/io.c
index c12f49a97..7164734c6 100644
--- a/src/io.c
+++ b/src/io.c
@@ -14,6 +14,16 @@
#include "mruby/ext/io.h"
#include "error.h"
+#if defined(_WIN32) || defined(_WIN64)
+ #include <io.h>
+ #define open _open
+ #define close _close
+ #define read _read
+ #define write _write
+ #define lseek _lseek
+#else
+#endif
+
static int mrb_io_modestr_to_flags(mrb_state *mrb, const char *modestr);
static int mrb_io_modenum_to_flags(mrb_state *mrb, int modenum);
static int mrb_io_flags_to_modenum(mrb_state *mrb, int flags);