Replace off_t with Windows-allowed value in AFC FFI

This commit is contained in:
Jackson Coxson
2026-01-05 07:23:55 -07:00
parent ae39fcb7df
commit 602e1ba855

View File

@@ -707,7 +707,7 @@ pub unsafe extern "C" fn afc_file_seek(
handle: *mut AfcFileHandle, handle: *mut AfcFileHandle,
offset: i64, offset: i64,
whence: libc::c_int, whence: libc::c_int,
new_pos: *mut libc::off_t, new_pos: *mut i64,
) -> *mut IdeviceFfiError { ) -> *mut IdeviceFfiError {
if handle.is_null() || new_pos.is_null() { if handle.is_null() || new_pos.is_null() {
return ffi_err!(IdeviceError::FfiInvalidArg); return ffi_err!(IdeviceError::FfiInvalidArg);
@@ -727,7 +727,7 @@ pub unsafe extern "C" fn afc_file_seek(
match res { match res {
Ok(pos) => { Ok(pos) => {
unsafe { unsafe {
*new_pos = pos as libc::off_t; *new_pos = pos as i64;
} }
null_mut() null_mut()
} }
@@ -753,7 +753,7 @@ pub unsafe extern "C" fn afc_file_seek(
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub unsafe extern "C" fn afc_file_tell( pub unsafe extern "C" fn afc_file_tell(
handle: *mut AfcFileHandle, handle: *mut AfcFileHandle,
pos: *mut libc::off_t, pos: *mut i64,
) -> *mut IdeviceFfiError { ) -> *mut IdeviceFfiError {
if handle.is_null() || pos.is_null() { if handle.is_null() || pos.is_null() {
return ffi_err!(IdeviceError::FfiInvalidArg); return ffi_err!(IdeviceError::FfiInvalidArg);
@@ -767,7 +767,7 @@ pub unsafe extern "C" fn afc_file_tell(
match res { match res {
Ok(cur) => { Ok(cur) => {
unsafe { unsafe {
*pos = cur as libc::off_t; *pos = cur as i64;
} }
null_mut() null_mut()
} }