Swap out some libc type aliases with std::ffi equivalents

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.
This commit is contained in:
Oliver Hamlet
2025-02-01 17:58:12 +00:00
parent d9c453a857
commit d7f5455cd0
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
use libc::c_int;
use std::ffi::c_int;
#[no_mangle]
pub static LCI_OK: c_int = 0;
+2 -2
View File
@@ -1,8 +1,8 @@
use std::ffi::{CStr, CString};
use std::ffi::{c_char, c_int, CStr, CString};
use std::path::PathBuf;
use std::slice;
use libc::{c_char, c_int, size_t};
use libc::size_t;
use loot_condition_interpreter::{Error, GameType};
use super::ERROR_MESSAGE;
+1 -2
View File
@@ -6,12 +6,11 @@ mod helpers;
mod state;
use std::cell::RefCell;
use std::ffi::CString;
use std::ffi::{c_char, c_int, CString};
use std::panic::catch_unwind;
use std::ptr;
use std::str::FromStr;
use libc::{c_char, c_int};
use loot_condition_interpreter::*;
pub use constants::*;
+2 -1
View File
@@ -1,8 +1,9 @@
use std::ffi::{c_char, c_int};
use std::panic::catch_unwind;
use std::path::PathBuf;
use std::sync::RwLock;
use libc::{c_char, c_int, size_t};
use libc::size_t;
use loot_condition_interpreter::State;
use crate::constants::*;