Commit a76011f9 authored by Chun-wei Fan's avatar Chun-wei Fan Committed by Philip Chimento

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().
parent dba6f0bd
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment