aboutsummaryrefslogtreecommitdiffstats
path: root/goruby.c
diff options
context:
space:
mode:
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 78d6dcad8d..310f236011 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));