mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Make "C"
explicit in extern "C"
.
This commit is contained in:
parent
b696870dd8
commit
a9b50c201b
@ -2255,7 +2255,7 @@ fn build_script_with_dynamic_native_dependency() {
|
|||||||
crate-type = ["dylib"]
|
crate-type = ["dylib"]
|
||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
.file("src/lib.rs", "#[no_mangle] pub extern fn foo() {}")
|
.file("src/lib.rs", r#"#[no_mangle] pub extern "C" fn foo() {}"#)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
let foo = project()
|
let foo = project()
|
||||||
@ -2316,7 +2316,7 @@ fn build_script_with_dynamic_native_dependency() {
|
|||||||
pub fn bar() {
|
pub fn bar() {
|
||||||
#[cfg_attr(not(target_env = "msvc"), link(name = "builder"))]
|
#[cfg_attr(not(target_env = "msvc"), link(name = "builder"))]
|
||||||
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
|
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
|
||||||
extern { fn foo(); }
|
extern "C" { fn foo(); }
|
||||||
unsafe { foo() }
|
unsafe { foo() }
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
@ -4821,7 +4821,7 @@ fn _rename_with_link_search_path(cross: bool, expected: impl IntoData) {
|
|||||||
)
|
)
|
||||||
.file(
|
.file(
|
||||||
"src/lib.rs",
|
"src/lib.rs",
|
||||||
"#[no_mangle] pub extern fn cargo_test_foo() {}",
|
r#"#[no_mangle] pub extern "C" fn cargo_test_foo() {}"#,
|
||||||
);
|
);
|
||||||
let p = p.build();
|
let p = p.build();
|
||||||
|
|
||||||
@ -4866,7 +4866,7 @@ fn _rename_with_link_search_path(cross: bool, expected: impl IntoData) {
|
|||||||
.file(
|
.file(
|
||||||
"src/main.rs",
|
"src/main.rs",
|
||||||
r#"
|
r#"
|
||||||
extern {
|
extern "C" {
|
||||||
#[link_name = "cargo_test_foo"]
|
#[link_name = "cargo_test_foo"]
|
||||||
fn foo();
|
fn foo();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user