Use core::ffi::c_void instead of libc::c_void

This commit is contained in:
Gary Guo 2021-08-26 03:48:18 +01:00
parent 855a3d3a9f
commit 54cbb9f8fc
5 changed files with 16 additions and 6 deletions

View File

@ -1,11 +1,12 @@
use core::ffi::c_void;
use core::ops;
use core::ptr;
use gimli::Register;
use libc::{c_int, c_void};
use crate::arch::*;
use crate::find_fde::{self, FDEFinder};
use crate::frame::Frame;
use crate::util::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

View File

@ -1,9 +1,11 @@
use super::FDESearchResult;
use crate::util::{deref_pointer, get_unlimited_slice};
use crate::find_fde::FDESearchResult;
use crate::util::*;
use core::ffi::c_void;
use core::mem;
use core::slice;
use gimli::{BaseAddresses, EhFrame, EhFrameHdr, NativeEndian, UnwindSection};
use libc::{c_int, c_void, dl_iterate_phdr, dl_phdr_info, PT_DYNAMIC, PT_GNU_EH_FRAME, PT_LOAD};
use libc::{dl_iterate_phdr, dl_phdr_info, PT_DYNAMIC, PT_GNU_EH_FRAME, PT_LOAD};
struct CallbackData {
pc: usize,

View File

@ -1,9 +1,9 @@
use super::FDESearchResult;
use crate::util::get_unlimited_slice;
use core::ffi::c_void;
use core::mem::MaybeUninit;
use core::ptr;
use gimli::{BaseAddresses, EhFrame, NativeEndian, UnwindSection};
use libc::c_void;
use once_cell::sync::Lazy;
use std::sync::Mutex;

View File

@ -3,10 +3,10 @@ use gimli::{
UninitializedUnwindContext, UnwindTableRow, Value,
};
use crate::abi::PersonalityRoutine;
use crate::arch::*;
use crate::find_fde::{self, FDEFinder, FDESearchResult};
use crate::util::*;
use crate::abi::PersonalityRoutine;
#[derive(Debug)]
pub struct Frame {

View File

@ -16,3 +16,10 @@ pub unsafe fn deref_pointer(ptr: Pointer) -> usize {
Pointer::Indirect(x) => unsafe { *(x as *const _) },
}
}
#[cfg(feature = "libc")]
pub use libc::c_int;
#[cfg(not(feature = "libc"))]
#[allow(non_camel_case_types)]
pub type c_int = i32;