diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-11-01 13:04:03 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-11-09 07:56:44 -0800 |
| commit | 5c3fe111d4a6e72f0461320f5166bcd6aaf2f37f (patch) | |
| tree | 48f0b9a3b4a7d115bd9bf29916adc437fed669fd /src/libstd/sys/unix/backtrace/printing/dladdr.rs | |
| parent | 348930eb4e75ee9ce42e783fe9942c8eb5165bc1 (diff) | |
| download | rust-5c3fe111d4a6e72f0461320f5166bcd6aaf2f37f.tar.gz rust-5c3fe111d4a6e72f0461320f5166bcd6aaf2f37f.zip | |
std: Avoid use of `libc` in portable modules
This commit removes usage of the `libc` crate in "portable" modules like those at the top level and `sys_common`. Instead common types like `*mut u8` or `u32` are used instead of `*mut c_void` or `c_int` as well as switching to platform-specific functions like `sys::strlen` instead of `libc::strlen`.
Diffstat (limited to 'src/libstd/sys/unix/backtrace/printing/dladdr.rs')
| -rw-r--r-- | src/libstd/sys/unix/backtrace/printing/dladdr.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/backtrace/printing/dladdr.rs b/src/libstd/sys/unix/backtrace/printing/dladdr.rs index 21f0b3724c1..bc56fd6594e 100644 --- a/src/libstd/sys/unix/backtrace/printing/dladdr.rs +++ b/src/libstd/sys/unix/backtrace/printing/dladdr.rs @@ -22,7 +22,7 @@ pub fn resolve_symname<F>(frame: Frame, { unsafe { let mut info: Dl_info = intrinsics::init(); - let symname = if dladdr(frame.exact_position, &mut info) == 0 || + let symname = if dladdr(frame.exact_position as *mut _, &mut info) == 0 || info.dli_sname.is_null() { None } else { @@ -41,6 +41,5 @@ struct Dl_info { } extern { - fn dladdr(addr: *const libc::c_void, - info: *mut Dl_info) -> libc::c_int; + fn dladdr(addr: *const libc::c_void, info: *mut Dl_info) -> libc::c_int; } |
