Skip to content

Commit

Permalink
Merge pull request #185 from LeadRDRK/rust-arm-fix
Browse files Browse the repository at this point in the history
[rust] Fix for ARM architecture
  • Loading branch information
rdbo authored Feb 19, 2024
2 parents f100d0e + 589613c commit 2774cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
use std::env;

fn main() {
let lib_path = if cfg!(windows) {
format!("{}{}", env::var("ProgramFiles").unwrap(), "\\libmem\\lib")
} else {
String::from("/usr/lib")
if cfg!(windows) {
let lib_path = format!("{}{}", env::var("ProgramFiles").unwrap(), "\\libmem\\lib");
println!("cargo:rustc-link-search={}", lib_path);
};

println!("cargo:rustc-link-search={}", lib_path);
}
4 changes: 2 additions & 2 deletions bindings/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#![allow(non_snake_case)]

use std::{
ffi::{CStr, CString},
ffi::{CStr, CString, c_char},
fmt, mem, ptr,
};

Expand Down Expand Up @@ -1100,7 +1100,7 @@ pub fn LM_DemangleSymbol(symbol: &str) -> Option<String> {
return None;
}

let cstr = CStr::from_ptr(newsym_raw as *const i8).to_owned();
let cstr = CStr::from_ptr(newsym_raw as *const c_char).to_owned();
let newsym = string_from_cstring(cstr.as_bytes_with_nul());

libmem_c::LM_FreeDemangleSymbol(newsym_raw);
Expand Down

0 comments on commit 2774cf8

Please sign in to comment.