Skip to content

Commit

Permalink
Use libc::c_char instead of i8 due to platforms with unsigned char
Browse files Browse the repository at this point in the history
  • Loading branch information
segevfiner committed Jan 27, 2017
1 parent 450554e commit 1b4a6c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libstd/sys/unix/backtrace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}
3 changes: 2 additions & 1 deletion src/libstd/sys/windows/backtrace_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1b4a6c8

Please sign in to comment.