Replace libc::{type} with crate::ffi::{type}

Replace libc::{type} imports with crate::ffi::{type} outside of
`std::sys` and `std::os`.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
This commit is contained in:
Ayush Singh
2022-12-10 13:34:19 +05:30
parent 6cd6bad51f
commit c50d3e28ab
5 changed files with 10 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ use crate::sys::net::{cvt, cvt_gai, cvt_r, init, wrlen_t, Socket};
use crate::sys_common::{AsInner, FromInner, IntoInner};
use crate::time::Duration;
use libc::{c_int, c_void};
use crate::ffi::{c_int, c_void};
cfg_if::cfg_if! {
if #[cfg(any(
@@ -47,7 +47,7 @@ cfg_if::cfg_if! {
target_os = "dragonfly", target_os = "freebsd",
target_os = "openbsd", target_os = "netbsd",
target_os = "solaris", target_os = "illumos"))] {
use libc::c_uchar;
use crate::ffi::c_uchar;
type IpV4MultiCastType = c_uchar;
} else {
type IpV4MultiCastType = c_int;
@@ -127,8 +127,8 @@ fn to_ipv6mr_interface(value: u32) -> c_int {
}
#[cfg(not(target_os = "android"))]
fn to_ipv6mr_interface(value: u32) -> libc::c_uint {
value as libc::c_uint
fn to_ipv6mr_interface(value: u32) -> crate::ffi::c_uint {
value as crate::ffi::c_uint
}
////////////////////////////////////////////////////////////////////////////////