[librsvg/master.msvc: 1/5] rsvg-convert.rs: Fix building on Windows
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/master.msvc: 1/5] rsvg-convert.rs: Fix building on Windows
- Date: Thu, 8 Jul 2021 16:30:04 +0000 (UTC)
commit 0370d84f425630f41de043c071ebea435025fbb3
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Jul 8 12:13:38 2021 +0800
rsvg-convert.rs: Fix building on Windows
Make sure we import the things we really need, and like what is
happening on *nix, the Win32 HANDLES that we get for stdin/stdout
need to be marked as unsafe before we can cast the resulting items.
Also make sure we deal with OutPutStream with the corresponding
Win32OutputStream.
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/565>
src/bin/rsvg-convert.rs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index cd1a699e..589f583f 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -9,7 +9,7 @@ use gio::{UnixInputStream, UnixOutputStream};
#[cfg(windows)]
mod windows_imports {
- pub use gio::ffi::{GInputStream, GOutputStream};
+ pub use gio::{Win32InputStream, Win32OutputStream};
pub use glib::ffi::gboolean;
pub use glib::translate::*;
pub use libc::c_void;
@@ -357,7 +357,8 @@ impl Stdin {
#[cfg(windows)]
pub fn stream() -> InputStream {
- Win32InputStream::with_handle(io::stdin()).upcast::<InputStream>()
+ let stream = unsafe { Win32InputStream::with_handle(io::stdin()) };
+ stream.upcast::<InputStream>()
}
}
@@ -372,7 +373,8 @@ impl Stdout {
#[cfg(windows)]
pub fn stream() -> OutputStream {
- Win32InputStream::with_handle(io::stdout()).upcast::<OutputStream>()
+ let stream = unsafe { Win32OutputStream::with_handle(io::stdout()) };
+ stream.upcast::<OutputStream>()
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]