Sign in
qemu
/
meson
/
f1f24816a912bacbb32931bfbd034be36138e3e4
/
.
/
test cases
/
rust
/
15 polyglot sharedlib
/
adder.rs
blob: ec4d1cc138b61378a9486d9e9daaf67f43afef05 [
file
] [
log
] [
blame
]
#[
repr
(
C
)]
pub
struct
Adder
{
pub
number
:
i32
}
extern
"C"
{
pub
fn
zero
()
->
i32
;
pub
fn
zero_static
()
->
i32
;
}
#[
no_mangle
]
pub
extern
fn
adder_add_r
(
a
:
&
Adder
,
number
:
i32
)
->
i32
{
unsafe
{
return
a
.
number
+
number
+
zero
()
+
zero_static
();
}
}