mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 13:50:05 -04:00
c_char isn't always i8
This commit is contained in:
@@ -5,7 +5,7 @@ use libc;
|
|||||||
use std::{mem, ptr};
|
use std::{mem, ptr};
|
||||||
use super::ffi;
|
use super::ffi;
|
||||||
|
|
||||||
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const i8) -> T {
|
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const libc::c_char) -> T {
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
let c_str = CString::from_slice(s.as_bytes());
|
let c_str = CString::from_slice(s.as_bytes());
|
||||||
f(c_str.as_slice_with_nul().as_ptr())
|
f(c_str.as_slice_with_nul().as_ptr())
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ fn ensure_thread_init() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const i8) -> T {
|
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const libc::c_char) -> T {
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
let c_str = CString::from_slice(s.as_bytes());
|
let c_str = CString::from_slice(s.as_bytes());
|
||||||
f(c_str.as_slice_with_nul().as_ptr())
|
f(c_str.as_slice_with_nul().as_ptr())
|
||||||
|
|||||||
Reference in New Issue
Block a user