From 436d4f62e0bdd14f30c64e0e2978601d8c8cc183 Mon Sep 17 00:00:00 2001 From: DianQK Date: Fri, 1 Dec 2023 22:16:32 +0800 Subject: [PATCH] Fix link name for `extern "C"` in msvc --- tests/run-make/no-builtins-lto/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/run-make/no-builtins-lto/main.rs b/tests/run-make/no-builtins-lto/main.rs index c474527a5ae..4421a2afbce 100644 --- a/tests/run-make/no-builtins-lto/main.rs +++ b/tests/run-make/no-builtins-lto/main.rs @@ -6,7 +6,8 @@ extern crate no_builtins; extern crate foo; -#[link(name = "c")] +#[cfg_attr(unix, link(name = "c"))] +#[cfg_attr(target_env = "msvc", link(name = "msvcrt"))] extern "C" {} #[start]