As far as I know, using use
inside a function doesn't have a performance impact. Is this also true when using extern "C"
? Is this pattern "allowed"?
fn default() {
#[link(name = "foo")]
extern "C" {
fn bar(x: i32);
}
bar(10);
}
As far as I know, using use
inside a function doesn't have a performance impact. Is this also true when using extern "C"
? Is this pattern "allowed"?
fn default() {
#[link(name = "foo")]
extern "C" {
fn bar(x: i32);
}
bar(10);
}
Yes. But the snippet needs a small adjustment...
fn default() {
#[link(name = "foo")]
extern "C" {
fn bar(x: i32);
}
unsafe { bar(10) };
}
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.