Skip to content

Commit 331d226

Browse files
committed
Fix ARM64 Linux build
1 parent 27bc08f commit 331d226

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

rust/src/function.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub use binaryninjacore_sys::BNFunctionAnalysisSkipOverride as FunctionAnalysisS
4040
pub use binaryninjacore_sys::BNFunctionUpdateType as FunctionUpdateType;
4141

4242
use std::{fmt, mem};
43-
use std::{hash::Hash, ops::Range};
43+
use std::{ffi::c_char, hash::Hash, ops::Range};
4444

4545
pub struct Location {
4646
pub arch: Option<CoreArchitecture>,
@@ -1499,7 +1499,7 @@ impl Function {
14991499
let arch = arch.unwrap_or_else(|| self.arch());
15001500
let enum_display_typeid = enum_display_typeid.map(BnStrCompatible::into_bytes_with_nul);
15011501
let enum_display_typeid_ptr = enum_display_typeid
1502-
.map(|x| x.as_ref().as_ptr() as *const i8)
1502+
.map(|x| x.as_ref().as_ptr() as *const c_char)
15031503
.unwrap_or(core::ptr::null());
15041504
unsafe {
15051505
BNSetIntegerConstantDisplayType(
@@ -1944,7 +1944,7 @@ impl Function {
19441944
.iter()
19451945
.position(|(alias, _value)| *alias == name)
19461946
{
1947-
let name = DEBUG_REPORT_ALIAS[alias_idx].1.as_ptr() as *const i8;
1947+
let name = DEBUG_REPORT_ALIAS[alias_idx].1.as_ptr() as *const c_char;
19481948
unsafe { BNRequestFunctionDebugReport(self.handle, name) }
19491949
} else {
19501950
let name = std::ffi::CString::new(name.to_string()).unwrap();

rust/src/mlil/function.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use core::hash::{Hash, Hasher};
2+
use std::ffi::c_char;
23

34
use binaryninjacore_sys::*;
45

@@ -127,7 +128,7 @@ impl MediumLevelILFunction {
127128
self.get_function().handle,
128129
offset,
129130
&mut raw_var_type,
130-
name.as_ref().as_ptr() as *const i8,
131+
name.as_ref().as_ptr() as *const c_char,
131132
)
132133
}
133134
}
@@ -270,7 +271,7 @@ impl MediumLevelILFunction {
270271
self.get_function().handle,
271272
offset,
272273
&mut var_type,
273-
name_c_str.as_ptr() as *const i8,
274+
name_c_str.as_ptr() as *const c_char,
274275
)
275276
}
276277
}
@@ -295,7 +296,7 @@ impl MediumLevelILFunction {
295296
self.get_function().handle,
296297
&var.raw(),
297298
&mut var_type,
298-
name_c_str.as_ptr() as *const i8,
299+
name_c_str.as_ptr() as *const c_char,
299300
ignore_disjoint_uses,
300301
)
301302
}

0 commit comments

Comments
 (0)