From d16ee17c08a383b77070f3ba40d91882c0cb56e8 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 18 Jan 2013 09:01:43 +0100 Subject: wixl: remove gio-unix dependency It is not available under Windows, but it can be easily implemented using Posix.read. --- tools/wixl/util.vala | 16 ++++++++++++++++ tools/wixl/wixl-heat.vala | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/wixl/util.vala b/tools/wixl/util.vala index e7fadcc..13269c7 100644 --- a/tools/wixl/util.vala +++ b/tools/wixl/util.vala @@ -143,4 +143,20 @@ namespace Wixl { return -1; } + + public class UnixInputStream : GLib.InputStream { + public int fd { get; set construct; } + + public UnixInputStream(int fd_) { + fd = fd_; + } + + public override ssize_t read ([CCode (array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.IOError { + return Posix.read(fd, buffer, buffer.length); + } + + public override bool close(GLib.Cancellable? cancellable = null) throws GLib.IOError { + return true; + } + } } // Wixl diff --git a/tools/wixl/wixl-heat.vala b/tools/wixl/wixl-heat.vala index 560367d..44989c2 100644 --- a/tools/wixl/wixl-heat.vala +++ b/tools/wixl/wixl-heat.vala @@ -61,7 +61,7 @@ public int main (string[] args) { var indent = " "; try { - var dis = new DataInputStream (new UnixInputStream (0, false)); + var dis = new DataInputStream (new UnixInputStream (0)); string line; while ((line = dis.read_line (null)) != null) { -- cgit