summaryrefslogtreecommitdiff
path: root/goruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-21 07:03:06 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-21 07:03:06 (GMT)
commit75583e52ce1303d142f9f34abe8e01e66f917cb6 (patch)
treef4aa47543e11003977a979b867959cb5e2497839 /goruby.c
parent7bc839bdd2befe13cbb41081cb430c28bcc1974c (diff)
* goruby.c: windows support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'goruby.c')
-rw-r--r--goruby.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/goruby.c b/goruby.c
index 78d6dca..310f236 100644
--- a/goruby.c
+++ b/goruby.c
@@ -1,5 +1,3 @@
-#include <unistd.h>
-
void Init_golf(void);
#define ruby_options goruby_options
#define ruby_run_node goruby_run_node
@@ -7,6 +5,14 @@ void Init_golf(void);
#undef ruby_options
#undef ruby_run_node
+#if defined _WIN32
+#include <io.h>
+#include <fcntl.h>
+#define pipe(p) _pipe(p, 32L, _O_NOINHERIT)
+#elif defined HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
RUBY_EXTERN void *ruby_options(int argc, char **argv);
RUBY_EXTERN int ruby_run_node(void*);
RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));