@@ -1,4 +1,5 @@
-use std::ffi::{c_char, c_void};
+use libc::c_char;
+use std::ffi::c_void;
#[repr(C)]
pub struct Object {
@@ -4,8 +4,11 @@
/// Traits to map between C structs and native Rust types.
/// Similar to glib-rs but a bit simpler and possibly more
/// idiomatic.
+
+use libc::c_char;
+
use std::borrow::Cow;
-use std::ffi::{c_char, c_void, CStr, CString};
+use std::ffi::{c_void, CStr, CString};
use std::fmt;
use std::fmt::Debug;
use std::mem;
@@ -166,7 +169,7 @@ pub trait FromForeign: CloneToForeign + Sized {
/// # use qemu::FromForeign;
/// let p = c"Hello, world!".as_ptr();
/// let s = unsafe {
- /// String::cloned_from_foreign(p as *const std::ffi::c_char)
+ /// String::cloned_from_foreign(p as *const libc::c_char)
/// };
/// assert_eq!(s, "Hello, world!");
/// ```
Allow working with Rust versions prior to 1.64. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- qemu/src/bindings/mod.rs | 3 ++- qemu/src/util/foreign.rs | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-)