mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
c_char fix
The i8 is a u8 on raspberry pi 4 aarch64 linux, c_char takes care of this automatically.
This commit is contained in:
parent
c4b0a2ec29
commit
7e86539e3d
2 changed files with 3 additions and 3 deletions
|
@ -1023,7 +1023,7 @@ fn scan_elf_dynamic_deps(
|
|||
)
|
||||
.unwrap(),
|
||||
) as usize;
|
||||
let c_buf: *const c_char = dynstr_data[dynstr_off..].as_ptr() as *const i8;
|
||||
let c_buf = dynstr_data[dynstr_off..].as_ptr() as *const c_char;
|
||||
let c_str = unsafe { CStr::from_ptr(c_buf) }.to_str().unwrap();
|
||||
if Path::new(c_str).file_name() == shared_lib_filename {
|
||||
shared_lib_index = Some(dyn_lib_index);
|
||||
|
|
|
@ -11,7 +11,7 @@ use roc_collections::all::MutMap;
|
|||
use roc_error_macros::internal_error;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
ffi::{CStr, c_char},
|
||||
io::{BufReader, BufWriter},
|
||||
mem,
|
||||
path::Path,
|
||||
|
@ -499,7 +499,7 @@ pub(crate) fn preprocess_macho(
|
|||
// std::ffi::CStr is actually not a char* under
|
||||
// the hood (!) but rather an array, so to strip
|
||||
// the trailing null bytes we have to use from_ptr.
|
||||
let c_str = unsafe { CStr::from_ptr(str_bytes.as_ptr() as *const i8) };
|
||||
let c_str = unsafe { CStr::from_ptr(str_bytes.as_ptr() as *const c_char) };
|
||||
|
||||
Path::new(c_str.to_str().unwrap())
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue