From b5b14ce34333a546153e9ba9b77aadff125ba296 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 10 Aug 2023 21:22:53 -0700 Subject: [PATCH] Use cxx_name instead of rust_name --- native/src/base/lib.rs | 12 ++++++------ native/src/boot/lib.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/native/src/base/lib.rs b/native/src/base/lib.rs index 10bbe67fb..a17971aa3 100644 --- a/native/src/base/lib.rs +++ b/native/src/base/lib.rs @@ -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]; } } diff --git a/native/src/boot/lib.rs b/native/src/boot/lib.rs index c02761fef..ead6d0894 100644 --- a/native/src/boot/lib.rs +++ b/native/src/boot/lib.rs @@ -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" {