diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2019-02-22 15:38:20 +0800 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-03-03 10:07:10 -0800 |
commit | a76011f9c06bc0f8003a28825d79db85fefa1f39 (patch) | |
tree | 29e8ec9e682321c85dcb782c2742026ef0f99328 /libgjs-private | |
parent | dba6f0bd19671d1919f5d9a159e1fe3dff88cac5 (diff) | |
download | gjs-a76011f9c06bc0f8003a28825d79db85fefa1f39.tar.gz |
gjs-util.c: Fix building gjs_open_bytes() on Windows
Show a message that the function is currently only supported on UNIX,
due to the use of g_unix_open_pipe().
Diffstat (limited to 'libgjs-private')
-rw-r--r-- | libgjs-private/gjs-util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libgjs-private/gjs-util.c b/libgjs-private/gjs-util.c index ea691f56..c110cc93 100644 --- a/libgjs-private/gjs-util.c +++ b/libgjs-private/gjs-util.c @@ -27,12 +27,15 @@ #include <string.h> #include <gio/gio.h> -#include <glib-unix.h> #include <glib.h> #include <glib/gi18n.h> #include "gjs-util.h" +#ifdef G_OS_UNIX +# include <glib-unix.h> +#endif + char * gjs_format_int_alternative_output(int n) { @@ -164,6 +167,7 @@ int gjs_open_bytes(GBytes* bytes, GError** error) { g_return_val_if_fail(bytes, -1); g_return_val_if_fail(error == NULL || *error == NULL, -1); +#ifdef G_OS_UNIX if (!g_unix_open_pipe(pipefd, FD_CLOEXEC, error)) return -1; @@ -186,4 +190,7 @@ int gjs_open_bytes(GBytes* bytes, GError** error) { } return pipefd[0]; +#else + g_error("%s is currently supported on UNIX only", __func__); +#endif } |