Avoid an explicit cast from *const c_uchar to *const c_char

As noted in the `ffi` module docs, passing pointer/length byte strings from
Rust to C++ is easier if we declare them as `*const c_uchar` on the Rust side,
but `const char *` (possibly signed) on the C++ side. This is allowed because
both pointer types are ABI-compatible, regardless of char signedness.
This commit is contained in:
Zalathar
2025-08-15 19:51:33 +10:00
parent 8d0a04966c
commit 44f5ec7d56
2 changed files with 3 additions and 3 deletions

View File

@@ -2438,7 +2438,7 @@ unsafe extern "C" {
OutputObjFile: *const c_char,
DebugInfoCompression: *const c_char,
UseEmulatedTls: bool,
ArgsCstrBuff: *const c_char,
ArgsCstrBuff: *const c_uchar, // See "PTR_LEN_STR".
ArgsCstrBuffLen: usize,
UseWasmEH: bool,
) -> *mut TargetMachine;