no longer unix-specific
This commit is contained in:
parent
409bd03621
commit
79f6d79eb8
|
@ -6,7 +6,6 @@ use std::convert::TryFrom;
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::{CStr, CString};
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
use std::os::raw::{c_char, c_uint};
|
use std::os::raw::{c_char, c_uint};
|
||||||
use std::os::unix::ffi::OsStrExt;
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
@ -400,7 +399,7 @@ impl StaticCallbacks {
|
||||||
}
|
}
|
||||||
fn path_into_void(data: *mut c_void, source: impl AsRef<Path>) -> Option<bool> {
|
fn path_into_void(data: *mut c_void, source: impl AsRef<Path>) -> Option<bool> {
|
||||||
*unsafe { (data as *mut *const c_char).as_mut()? } =
|
*unsafe { (data as *mut *const c_char).as_mut()? } =
|
||||||
CString::new(source.as_ref().as_os_str().as_bytes()).ok()?.into_raw();
|
CString::new(source.as_ref().to_str()?.as_bytes()).ok()?.into_raw();
|
||||||
Some(true)
|
Some(true)
|
||||||
}
|
}
|
||||||
fn from_void<T>(data: *mut c_void) -> Option<&'static mut T> {
|
fn from_void<T>(data: *mut c_void) -> Option<&'static mut T> {
|
||||||
|
|
Loading…
Reference in New Issue