From c859dbc67cda3fdf79a4fb88da84adfa9c36ee0c Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 27 Jan 2022 15:03:50 +0800 Subject: [PATCH] Fix no-std builds. --- no_std/no_std_test/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/no_std/no_std_test/src/main.rs b/no_std/no_std_test/src/main.rs index a6385cb4..621029ee 100644 --- a/no_std/no_std_test/src/main.rs +++ b/no_std/no_std_test/src/main.rs @@ -14,7 +14,7 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[cfg(all(windows, target_env = "msvc"))] #[link(name = "msvcrt")] #[link(name = "libcmt")] -extern {} +extern "C" {} use rhai::{Engine, INT}; @@ -39,8 +39,11 @@ extern "C" fn rust_begin_panic(_: &core::panic::PanicInfo) -> ! { core::intrinsics::abort(); } -#[lang = "eh_personality"] -extern "C" fn eh_personality() {} +#[no_mangle] +extern "C" fn _rust_eh_personality() {} + +#[no_mangle] +extern "C" fn rust_eh_personality() {} #[no_mangle] extern "C" fn rust_eh_register_frames() {}