2021-11-01 17:49:58 -05:00
|
|
|
// only-x86
|
|
|
|
// only-windows
|
2021-07-12 14:46:27 -05:00
|
|
|
// compile-flags: --crate-type lib --emit link
|
|
|
|
#![allow(clashing_extern_declarations)]
|
|
|
|
#![feature(raw_dylib)]
|
|
|
|
#[link(name = "foo", kind = "raw-dylib")]
|
|
|
|
extern "C" {
|
|
|
|
fn f(x: i32);
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn lib_main() {
|
|
|
|
#[link(name = "foo", kind = "raw-dylib")]
|
|
|
|
extern "stdcall" {
|
|
|
|
fn f(x: i32);
|
|
|
|
//~^ ERROR multiple declarations of external function `f` from library `foo.dll` have different calling conventions
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe { f(42); }
|
|
|
|
}
|