Skip to content

Commit

Permalink
Use std::ffi::{c_char, c_float} instead of libc's
Browse files Browse the repository at this point in the history
They're equivalent. Unfortunately std::ffi::c_size_t is currently experimental, and if I define c_size_t = usize myself then cbindgen doesn't recognise it properly and makes c_size_t a typedef of uintptr_t instead of just replacing it with size_t.
  • Loading branch information
Ortham committed Feb 1, 2025
1 parent 18e084f commit 995acd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ffi/src/common.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ffi::CString;
use std::ffi::{c_char, CString};

use libc::{c_char, size_t};
use libc::size_t;

/// Free the memory allocated for the given string.
///
Expand Down
4 changes: 2 additions & 2 deletions ffi/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ffi::{CStr, CString};
use std::ffi::{c_char, CStr, CString};

use libc::{c_char, size_t};
use libc::size_t;

use esplugin::{GameId, Plugin};

Expand Down
3 changes: 2 additions & 1 deletion ffi/src/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::ffi::{c_char, c_float};
use std::path::Path;
use std::{f32, panic, ptr};

use libc::{c_char, c_float, size_t};
use libc::size_t;

use esplugin::{ParseOptions, Plugin, PluginMetadata};

Expand Down

0 comments on commit 995acd5

Please sign in to comment.