Use cxx_name instead of rust_name

This commit is contained in:
topjohnwu 2023-08-10 21:22:53 -07:00
parent 350d0d600c
commit b5b14ce343
2 changed files with 12 additions and 12 deletions

View File

@ -42,11 +42,11 @@ pub mod ffi {
#[namespace = "rust"]
extern "Rust" {
fn xpipe2(fds: &mut [i32; 2], flags: i32) -> i32;
#[rust_name = "fd_path_for_cxx"]
fn fd_path(fd: i32, buf: &mut [u8]) -> isize;
#[rust_name = "map_file_for_cxx"]
fn map_file(path: &[u8], rw: bool) -> &'static mut [u8];
#[rust_name = "map_fd_for_cxx"]
fn map_fd(fd: i32, sz: usize, rw: bool) -> &'static mut [u8];
#[cxx_name = "fd_path"]
fn fd_path_for_cxx(fd: i32, buf: &mut [u8]) -> isize;
#[cxx_name = "map_file"]
fn map_file_for_cxx(path: &[u8], rw: bool) -> &'static mut [u8];
#[cxx_name = "map_fd"]
fn map_fd_for_cxx(fd: i32, sz: usize, rw: bool) -> &'static mut [u8];
}
}

View File

@ -23,12 +23,12 @@ pub mod ffi {
fn decompress(buf: &[u8], fd: i32) -> bool;
include!("bootimg.hpp");
#[rust_name = "BootImage"]
type boot_img;
#[rust_name = "payload"]
fn get_payload(self: &BootImage) -> &[u8];
#[rust_name = "tail"]
fn get_tail(self: &BootImage) -> &[u8];
#[cxx_name = "boot_img"]
type BootImage;
#[cxx_name = "get_payload"]
fn payload(self: &BootImage) -> &[u8];
#[cxx_name = "get_tail"]
fn tail(self: &BootImage) -> &[u8];
}
extern "Rust" {