Skip to content

Commit df62de5

Browse files
author
bors-servo
authored
Auto merge of #279 - silwol:master, r=jrmuizel
Use libc c_char instead of i8 for libc strlen() call This patch allows build errors like https://buildd.debian.org/status/fetch.php?pkg=rust-core-foundation&arch=arm64&ver=0.6.1-1&stamp=1533301991&raw=0 to go through on architectures that use u8 as c_char. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/279) <!-- Reviewable:end -->
2 parents 42a6014 + e2ae28c commit df62de5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core-foundation/src/url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::ptr;
2020
use std::path::{Path, PathBuf};
2121
use std::mem;
2222

23-
use libc::{strlen, PATH_MAX};
23+
use libc::{c_char, strlen, PATH_MAX};
2424

2525
#[cfg(unix)]
2626
use std::os::unix::ffi::OsStrExt;
@@ -83,7 +83,7 @@ impl CFURL {
8383
if result == false as Boolean {
8484
return None;
8585
}
86-
let len = strlen(buf.as_ptr() as *const i8);
86+
let len = strlen(buf.as_ptr() as *const c_char);
8787
let path = OsStr::from_bytes(&buf[0..len]);
8888
Some(PathBuf::from(path))
8989
}

0 commit comments

Comments
 (0)