[gjs/master.windows: 10/18] gjs/debugger.cpp: Fix build on Windows



commit c61de41af8ec3e659ddbce1eedb0a25bb663b7b6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Feb 22 13:19:04 2019 +0800

    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.

 gjs/debugger.cpp | 11 +++++++++--
 1 file 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]