Skip to content

Commit

Permalink
ffi: Use std::ffi types instead of libc
Browse files Browse the repository at this point in the history
These aliases were added in rust 1.64.
  • Loading branch information
A6GibKm committed Sep 7, 2024
1 parent 733904c commit 0178f84
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/analysis/ffi_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn ffi_inner(env: &Env, tid: TypeId, inner: &str) -> Result {
Type::Basic(fund) => {
use crate::library::Basic::*;
let inner = match fund {
None => "libc::c_void",
None => "std::ffi::c_void",
Boolean => return Ok(use_glib_if_needed(env, "ffi::gboolean").into()),
Int8 => "i8",
UInt8 => "u8",
Expand All @@ -82,18 +82,18 @@ fn ffi_inner(env: &Env, tid: TypeId, inner: &str) -> Result {
UInt32 => "u32",
Int64 => "i64",
UInt64 => "u64",
Char => "libc::c_char",
UChar => "libc::c_uchar",
Short => "libc::c_short",
UShort => "libc::c_ushort",
Int => "libc::c_int",
UInt => "libc::c_uint",
Long => "libc::c_long",
ULong => "libc::c_ulong",
Char => "std::ffi::c_char",
UChar => "std::ffi::c_uchar",
Short => "std::ffi::c_short",
UShort => "std::ffi::c_ushort",
Int => "std::ffi::c_int",
UInt => "std::ffi::c_uint",
Long => "std::ffi::c_long",
ULong => "std::ffi::c_ulong",
Size => "libc::size_t",
SSize => "libc::ssize_t",
Float => "libc::c_float",
Double => "libc::c_double",
Float => "std::ffi::c_float",
Double => "std::ffi::c_double",
TimeT => "libc::time_t",
OffT => "libc::off_t",
DevT => "libc::dev_t",
Expand All @@ -102,8 +102,8 @@ fn ffi_inner(env: &Env, tid: TypeId, inner: &str) -> Result {
SockLenT => "libc::socklen_t",
UidT => "libc::uid_t",
UniChar => "u32",
Utf8 => "libc::c_char",
Filename => "libc::c_char",
Utf8 => "std::ffi::c_char",
Filename => "std::ffi::c_char",
Type => return Ok(use_glib_if_needed(env, "ffi::GType").into()),
IntPtr => "libc::intptr_t",
UIntPtr => "libc::uintptr_t",
Expand Down

0 comments on commit 0178f84

Please sign in to comment.