Skip to content

Commit d9be0bf

Browse files
mutexlox-signalpadenot
authored andcommitted
Fix build on arm64 linux.
On arm64 linux, c_char is u8. CStr::from_ptr is documented to take an i8, but this is not accurate (see rust-lang/rust#113735); instead, it takes c_char, which is sometimes but not always the same. One time it is different is on aarch64 Linux, so without this commit, cubeb-rs fails to build there.
1 parent dff28a9 commit d9be0bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cubeb-sys/src/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl Default for cubeb_device_info {
182182

183183
impl fmt::Debug for cubeb_device_info {
184184
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
185-
fn optional_c_str(c_str: *const i8) -> Option<*const i8> {
185+
fn optional_c_str(c_str: *const c_char) -> Option<*const c_char> {
186186
(unsafe { c_str.as_ref() }).map(ptr::from_ref)
187187
}
188188
f.debug_struct("cubeb_device_info")

0 commit comments

Comments
 (0)