summaryrefslogtreecommitdiff
path: root/gjs
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-02-22 13:19:04 +0800
committerPhilip Chimento <philip.chimento@gmail.com>2019-03-03 10:05:40 -0800
commitc61de41af8ec3e659ddbce1eedb0a25bb663b7b6 (patch)
treef024e6c4e8a8ae808b47f4b483fb1d3aac02adcc /gjs
parent5d222f489248660829842a4cfdb9d0fc17921d05 (diff)
downloadgjs-c61de41af8ec3e659ddbce1eedb0a25bb663b7b6.tar.gz
gjs/debugger.cpp: Fix build on Windows
Don't include unistd.h on Windows, instead include io.h for isatty() and define STDIN_FILENO as necessary.
Diffstat (limited to 'gjs')
-rw-r--r--gjs/debugger.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/gjs/debugger.cpp b/gjs/debugger.cpp
index eb6c9f50..47f6e921 100644
--- a/gjs/debugger.cpp
+++ b/gjs/debugger.cpp
@@ -22,8 +22,6 @@
* Authored By: Philip Chimento <philip.chimento@gmail.com>
*/
-#include <unistd.h>
-
#include <gio/gio.h>
#include "gjs/context-private.h"
@@ -36,6 +34,15 @@
#include <stdio.h>
#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#elif defined(XP_WIN)
+# include <io.h>
+# ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+# endif
+#endif
+
GJS_JSAPI_RETURN_CONVENTION
static bool quit(JSContext* cx, unsigned argc, JS::Value* vp) {
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);