Skip to content

Commit

Permalink
Fix C/Rust FFI pointer type to resolve arm64 compatibility issue and …
Browse files Browse the repository at this point in the history
…update generated sys.rs
  • Loading branch information
micahsnyder committed Dec 14, 2023
1 parent e19ac74 commit 1da576f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
59 changes: 30 additions & 29 deletions libclamav_rust/src/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,35 +379,36 @@ pub const cli_file_CL_TYPE_OOXML_HWP: cli_file = 551;
pub const cli_file_CL_TYPE_PS: cli_file = 552;
pub const cli_file_CL_TYPE_EGG: cli_file = 553;
pub const cli_file_CL_TYPE_ONENOTE: cli_file = 554;
pub const cli_file_CL_TYPE_PART_ANY: cli_file = 555;
pub const cli_file_CL_TYPE_PART_HFSPLUS: cli_file = 556;
pub const cli_file_CL_TYPE_MBR: cli_file = 557;
pub const cli_file_CL_TYPE_HTML: cli_file = 558;
pub const cli_file_CL_TYPE_MAIL: cli_file = 559;
pub const cli_file_CL_TYPE_SFX: cli_file = 560;
pub const cli_file_CL_TYPE_ZIPSFX: cli_file = 561;
pub const cli_file_CL_TYPE_RARSFX: cli_file = 562;
pub const cli_file_CL_TYPE_7ZSFX: cli_file = 563;
pub const cli_file_CL_TYPE_CABSFX: cli_file = 564;
pub const cli_file_CL_TYPE_ARJSFX: cli_file = 565;
pub const cli_file_CL_TYPE_EGGSFX: cli_file = 566;
pub const cli_file_CL_TYPE_NULSFT: cli_file = 567;
pub const cli_file_CL_TYPE_AUTOIT: cli_file = 568;
pub const cli_file_CL_TYPE_ISHIELD_MSI: cli_file = 569;
pub const cli_file_CL_TYPE_ISO9660: cli_file = 570;
pub const cli_file_CL_TYPE_DMG: cli_file = 571;
pub const cli_file_CL_TYPE_GPT: cli_file = 572;
pub const cli_file_CL_TYPE_APM: cli_file = 573;
pub const cli_file_CL_TYPE_XDP: cli_file = 574;
pub const cli_file_CL_TYPE_XML_WORD: cli_file = 575;
pub const cli_file_CL_TYPE_XML_XL: cli_file = 576;
pub const cli_file_CL_TYPE_XML_HWP: cli_file = 577;
pub const cli_file_CL_TYPE_HWPOLE2: cli_file = 578;
pub const cli_file_CL_TYPE_MHTML: cli_file = 579;
pub const cli_file_CL_TYPE_LNK: cli_file = 580;
pub const cli_file_CL_TYPE_UDF: cli_file = 581;
pub const cli_file_CL_TYPE_OTHER: cli_file = 582;
pub const cli_file_CL_TYPE_IGNORED: cli_file = 583;
pub const cli_file_CL_TYPE_PYTHON_COMPILED: cli_file = 555;
pub const cli_file_CL_TYPE_PART_ANY: cli_file = 556;
pub const cli_file_CL_TYPE_PART_HFSPLUS: cli_file = 557;
pub const cli_file_CL_TYPE_MBR: cli_file = 558;
pub const cli_file_CL_TYPE_HTML: cli_file = 559;
pub const cli_file_CL_TYPE_MAIL: cli_file = 560;
pub const cli_file_CL_TYPE_SFX: cli_file = 561;
pub const cli_file_CL_TYPE_ZIPSFX: cli_file = 562;
pub const cli_file_CL_TYPE_RARSFX: cli_file = 563;
pub const cli_file_CL_TYPE_7ZSFX: cli_file = 564;
pub const cli_file_CL_TYPE_CABSFX: cli_file = 565;
pub const cli_file_CL_TYPE_ARJSFX: cli_file = 566;
pub const cli_file_CL_TYPE_EGGSFX: cli_file = 567;
pub const cli_file_CL_TYPE_NULSFT: cli_file = 568;
pub const cli_file_CL_TYPE_AUTOIT: cli_file = 569;
pub const cli_file_CL_TYPE_ISHIELD_MSI: cli_file = 570;
pub const cli_file_CL_TYPE_ISO9660: cli_file = 571;
pub const cli_file_CL_TYPE_DMG: cli_file = 572;
pub const cli_file_CL_TYPE_GPT: cli_file = 573;
pub const cli_file_CL_TYPE_APM: cli_file = 574;
pub const cli_file_CL_TYPE_XDP: cli_file = 575;
pub const cli_file_CL_TYPE_XML_WORD: cli_file = 576;
pub const cli_file_CL_TYPE_XML_XL: cli_file = 577;
pub const cli_file_CL_TYPE_XML_HWP: cli_file = 578;
pub const cli_file_CL_TYPE_HWPOLE2: cli_file = 579;
pub const cli_file_CL_TYPE_MHTML: cli_file = 580;
pub const cli_file_CL_TYPE_LNK: cli_file = 581;
pub const cli_file_CL_TYPE_UDF: cli_file = 582;
pub const cli_file_CL_TYPE_OTHER: cli_file = 583;
pub const cli_file_CL_TYPE_IGNORED: cli_file = 584;
pub type cli_file = ::std::os::raw::c_uint;
pub use self::cli_file as cli_file_t;
#[repr(C)]
Expand Down
2 changes: 1 addition & 1 deletion libclamav_rust/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn file_from_fd_or_handle(fd: i32) -> File {
/// exceeds the lifetime of the output string.
///
/// ptr must be a valid pointer to a C string.
pub unsafe fn str_from_ptr(ptr: *const i8) -> Result<Option<&'static str>, std::str::Utf8Error> {
pub unsafe fn str_from_ptr(ptr: *const ::std::os::raw::c_char) -> Result<Option<&'static str>, std::str::Utf8Error> {
if ptr.is_null() {
return Ok(None);
}
Expand Down

0 comments on commit 1da576f

Please sign in to comment.