Use libc::c_char instead of i8 due to platforms with unsigned char

This commit is contained in:
Segev Finer 2017-01-28 01:01:16 +02:00
parent 450554ebf1
commit 1b4a6c86fa
2 changed files with 4 additions and 2 deletions

View File

@ -94,8 +94,9 @@ mod printing;
pub mod gnu {
use io;
use fs;
use libc::c_char;
pub fn get_executable_filename() -> io::Result<(Vec<i8>, fs::File)> {
pub fn get_executable_filename() -> io::Result<(Vec<c_char>, fs::File)> {
Err(io::Error::new(io::ErrorKind::Other, "Not implemented"))
}
}

View File

@ -10,6 +10,7 @@
use io;
use sys::c;
use libc::c_char;
use path::PathBuf;
use fs::{OpenOptions, File};
use sys::ext::fs::OpenOptionsExt;
@ -53,7 +54,7 @@ fn lock_and_get_executable_filename() -> io::Result<(PathBuf, File)> {
// Get the executable filename for libbacktrace
// This returns the path in the ANSI code page and a File which should remain open
// for as long as the path should remain valid
pub fn get_executable_filename() -> io::Result<(Vec<i8>, File)> {
pub fn get_executable_filename() -> io::Result<(Vec<c_char>, File)> {
let (executable, file) = lock_and_get_executable_filename()?;
let u16_executable = to_u16s(executable.into_os_string())?;
Ok((wide_char_to_multi_byte(c::CP_ACP, c::WC_NO_BEST_FIT_CHARS,