Patch core-foundation libc call to build on all architectures
Wolfgang Silbermayr
5 years ago
+34
-0
0 | From 2cffc810d382f83b7ac5073fa9c57dc7d208803c Mon Sep 17 00:00:00 2001 | |
1 | From: Wolfgang Silbermayr <wolfgang@silbermayr.at> | |
2 | Date: Fri, 7 Dec 2018 06:11:50 +0100 | |
3 | Subject: [PATCH] Use libc c_char instead of i8 for libc calls | |
4 | ||
5 | --- | |
6 | src/url.rs | 4 ++-- | |
7 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
8 | ||
9 | diff --git a/src/url.rs b/src/url.rs | |
10 | index edf1de8..199ad2e 100644 | |
11 | --- a/src/url.rs | |
12 | +++ b/src/url.rs | |
13 | @@ -20,7 +20,7 @@ use std::ptr; | |
14 | use std::path::{Path, PathBuf}; | |
15 | use std::mem; | |
16 | ||
17 | -use libc::{strlen, PATH_MAX}; | |
18 | +use libc::{c_char, strlen, PATH_MAX}; | |
19 | ||
20 | #[cfg(unix)] | |
21 | use std::os::unix::ffi::OsStrExt; | |
22 | @@ -83,7 +83,7 @@ impl CFURL { | |
23 | if result == false as Boolean { | |
24 | return None; | |
25 | } | |
26 | - let len = strlen(buf.as_ptr() as *const i8); | |
27 | + let len = strlen(buf.as_ptr() as *const c_char); | |
28 | let path = OsStr::from_bytes(&buf[0..len]); | |
29 | Some(PathBuf::from(path)) | |
30 | } | |
31 | -- | |
32 | 2.20.0.rc2 | |
33 |
0 | 0001-Use-libc-c_char-instead-of-i8-for-libc-calls.patch |