Use a dedicated safe wrapper for LLVMRustGetHostCPUName

This commit is contained in:
Zalathar 2024-11-02 11:44:15 +11:00
parent 36040aacc2
commit 0fa86f9660
3 changed files with 23 additions and 15 deletions

View file

@ -2204,7 +2204,7 @@ unsafe extern "C" {
Desc: &mut *const c_char,
);
pub fn LLVMRustGetHostCPUName(len: *mut usize) -> *const c_char;
pub fn LLVMRustGetHostCPUName(LenOut: &mut size_t) -> *const u8;
// This function makes copies of pointed to data, so the data's lifetime may end after this
// function returns.