Skip to content

Commit

Permalink
uplink(fix): Use c_char for char FFI
Browse files Browse the repository at this point in the history
`char` in C maps to different types in x86 vs. ARM (`i8` vs `u8`).
This may affect other architectures as well.

Use `c_char` for FFI instead to avoid compile errors on different
architectures.
  • Loading branch information
GodTamIt authored and ifraixedes committed Dec 31, 2024
1 parent 3800931 commit 4fb6132
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions uplink/src/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Storj DCS metadata types.
use std::collections::HashMap;
use std::ffi::c_char;
use std::ptr;
use std::time::Duration;
use std::vec::Vec;
Expand Down Expand Up @@ -158,9 +159,9 @@ impl UplinkCustomMetadataWrapper {
let mut entries = Vec::with_capacity(num_entries);
for (k, v) in custom.iter() {
entries.push(ulksys::UplinkCustomMetadataEntry {
key: k.as_ptr() as *mut i8,
key: k.as_ptr() as *mut c_char,
key_length: k.len(),
value: v.as_ptr() as *mut i8,
value: v.as_ptr() as *mut c_char,
value_length: v.len(),
});
}
Expand Down

0 comments on commit 4fb6132

Please sign in to comment.