Skip to content

Commit 0178f84

Browse files
committed
ffi: Use std::ffi types instead of libc
These aliases were added in rust 1.64.
1 parent 733904c commit 0178f84

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/analysis/ffi_type.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn ffi_inner(env: &Env, tid: TypeId, inner: &str) -> Result {
7272
Type::Basic(fund) => {
7373
use crate::library::Basic::*;
7474
let inner = match fund {
75-
None => "libc::c_void",
75+
None => "std::ffi::c_void",
7676
Boolean => return Ok(use_glib_if_needed(env, "ffi::gboolean").into()),
7777
Int8 => "i8",
7878
UInt8 => "u8",
@@ -82,18 +82,18 @@ fn ffi_inner(env: &Env, tid: TypeId, inner: &str) -> Result {
8282
UInt32 => "u32",
8383
Int64 => "i64",
8484
UInt64 => "u64",
85-
Char => "libc::c_char",
86-
UChar => "libc::c_uchar",
87-
Short => "libc::c_short",
88-
UShort => "libc::c_ushort",
89-
Int => "libc::c_int",
90-
UInt => "libc::c_uint",
91-
Long => "libc::c_long",
92-
ULong => "libc::c_ulong",
85+
Char => "std::ffi::c_char",
86+
UChar => "std::ffi::c_uchar",
87+
Short => "std::ffi::c_short",
88+
UShort => "std::ffi::c_ushort",
89+
Int => "std::ffi::c_int",
90+
UInt => "std::ffi::c_uint",
91+
Long => "std::ffi::c_long",
92+
ULong => "std::ffi::c_ulong",
9393
Size => "libc::size_t",
9494
SSize => "libc::ssize_t",
95-
Float => "libc::c_float",
96-
Double => "libc::c_double",
95+
Float => "std::ffi::c_float",
96+
Double => "std::ffi::c_double",
9797
TimeT => "libc::time_t",
9898
OffT => "libc::off_t",
9999
DevT => "libc::dev_t",
@@ -102,8 +102,8 @@ fn ffi_inner(env: &Env, tid: TypeId, inner: &str) -> Result {
102102
SockLenT => "libc::socklen_t",
103103
UidT => "libc::uid_t",
104104
UniChar => "u32",
105-
Utf8 => "libc::c_char",
106-
Filename => "libc::c_char",
105+
Utf8 => "std::ffi::c_char",
106+
Filename => "std::ffi::c_char",
107107
Type => return Ok(use_glib_if_needed(env, "ffi::GType").into()),
108108
IntPtr => "libc::intptr_t",
109109
UIntPtr => "libc::uintptr_t",

0 commit comments

Comments
 (0)